Angular2 step by step 2 – How to install latest Node.js and NPM

By W.ZH Oct 2016

Install latest Node.js, from Node.js website:

First, make sure you have a C++ compiler. Open the terminal and install the build-essential and libssl-dev packages if needed. By default, Ubuntu does not come with these tools — but they can be installed in the command line.

Use apt-get to install the build-essential package and libssl-dev:

sudo apt-get install build-essential checkinstall

sudo apt-get install libssl-dev

You can install and update Node Version Manager, or nvm, by using cURL:

curl -o- | bash

You will be asked to close and reopen the terminal. To verify that nvm has been successfully installed after you reopen the terminal, use:

command -v nvm

That command will output nvm if the installation worked.

To download, compile and install the latest version of Node:


Install latest NPM

There’s a pretty robust install script at You can download that and run it.

Here’s an example using curl:

curl -L | sh