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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With