Installing node.js on Ubuntu (16.04 specifically)

how-to-install-node-js-on-ubuntu-16-04 has a great explanation, but long, about the details.

The short version come here:

  1. Do NOT use the ubuntu package version. It´s old and named ´nodejs´ instead of ´node´
  2. curl -sL https://deb.nodesource.com/setup_8.x -o nodesource_setup.sh
  3. sudo bash nodesource_setup.sh
  4. sudo apt-get install nodejs
  5. nodejs -v (symbolic link pointing to /usr/bin/node) should print out v8.10.0 or higher
  6. npm is included so verify that it is working
  7. sudo apt-get install build-essential

In the case where you NEED multiple versions of node installed, look for the NVM section is the above link. However in most cases I don´t think this is necessary, but for advanced installations it might be.

NVM is inspired by the RVM Ruby versioning tool

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.