sudo npm install command not found

20,208

Correct npm path is /usr/local/bin/npm else just run below command again

sudo apt-get install npm

And verify the npm is install, Alternatively you can try:

sudo ln -s /usr/local/lib/node /usr/lib/node
sudo ln -s /usr/local/bin/npm /usr/bin/npm
Share:
20,208
Jabaa
Author by

Jabaa

Updated on April 28, 2021

Comments

  • Jabaa
    Jabaa about 3 years

    I have installed nodejs and npm in my server (os:amazon ami) using node version manager current node version is 7.10.0 npm version is 4.2.0

    nodejs project is located in var/www/testing folder when i am trying to install the depeondeies present in package.json using sudo npm install i got command not found error

    Path of node and npm is respectively

    ~/.nvm/versions/node/v7.10.0/bin/node
    
    ~/.nvm/versions/node/v7.10.0/bin/npm
    

    npm and node are in same folder but when I try this command:

    sudo npm install I got sudo: npm: command not found

    npm install command throws no errors but node_modules folder is empty.

  • Serve
    Serve almost 7 years
    Which os you are using ? Reinstall it as global
  • Jabaa
    Jabaa almost 7 years
    Amazone linux ami
  • Serve
    Serve almost 7 years
    For amazon linux AMI just use these commands again git clone github.com/isaacs/npm.git cd npm sudo make install