Skip to content

npm & node Installation or update

Mohammad Umer edited this page May 5, 2016 · 2 revisions

Linux & Mac (Slightly different)

1- To check if npm is installed or not, type

$ npm -v
This would be the output in terminal
umer@Umer:~$ npm -v
3.8.6

2- If npm is not installed, then run these commands

  1. $ sudo npm install npm -g
  2. $ npm -v
    3.8.6

3. Then check whether node and nodejs is installed by typing these commands

  1. $ node -v
  2. $ nodejs -v If it returns the version then it is installed
    It would look like this in terminal
    umer@Umer:~$ node -v
    v6.0.0
    umer@Umer:~$ nodejs -v
    v4.4.3

4. For the installation of nodejs

  1. $ sudo npm cache clean -f
  2. $ sudo npm install -g n
  3. $ sudo n stable