Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sudo npm install command not found

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.

like image 437
Jabaa Avatar asked Aug 31 '25 01:08

Jabaa


1 Answers

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
like image 137
Serve Avatar answered Sep 02 '25 17:09

Serve