sudo: npm: command not found sudo: npm: command not found unix unix

sudo: npm: command not found


I had to do

sudo apt-get install npm

that worked for me.


The npm file should be in /usr/local/bin/npm. If it's not there, install node.js again with the package on their website. This worked in my case.


For MAC users, the follow steps worked for me.

If you get Error for Brew, Here's the command you need to type first in the terminal:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Then run following commands:
$ brew update$ brew uninstall node$ brew install node$ brew postinstall