Since I've had to figure out how to do this twice now,
and the NodeSource instructions make this more confusing than it ought to be.
Make sure you replace node_6.x
with the appropriate version from the
installation instructions
and xenial
with the results of lsb_release -s -c
.
- name: NodeSource package key
apt_key:
state: present
url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key
- name: NodeSource repository
apt_repository:
repo: 'deb https://deb.nodesource.com/node_6.x xenial main'
- name: Install NodeJS
apt:
state: present
name: nodejs
I wanted to install SleepyHead on my new computer (running Ubuntu 14.04 Trusty), but there's no package in the Ubuntu repositories. SleepyHead has instructions for building from source on their wiki, but they don't tell you which packages you need, which is the difficult bit of the process. After some trial and error, I arrived at the following instructions, which worked for me and which I believe to be accurate.