NodeJS and NPM are both prerequisites of an Angular 2 app. You need to install these first. Go to http://nodejs.org/en/download and click the correct installer for your computer:
Click the file after the download and it will install both NodeJS and NPM.
After the installation, you can now verify if Node and NPM are successfully installed by checking their version through your terminal:
As you can see the command for checking the version is “node -v” and “npm -v”. Their versions should be seen immediately. And there, you have successfully installed NodeJS and NPM on your computer.
But as we’ve said, Angular 2 is relatively new and going through changes often and it’s important to keep up with the updates for NodeJS and NPM. First, you have to take note of your current version to compare them to your updated version.
In your terminal, it should look like this:
As you can see, we checked the version first then typed “sudo-i” to login to “root”. Next is “npm install npm -g” to install the updates for Node. And last is “npm cache clean -f” then “n stable” for NPM. After each update we compare the versions to the previous ones and there you have it! Your NodeJS and NPM are now updated.
Checking for updates and fixes for Node and NPM are highly recommended because of it’s rapid changing behavior.