Jeff Tian
Jeff Tian

Reputation: 5893

How to bring `npm` back?

I installed nodejs via nvm on Ubuntu server, and found issues with jenkins tasks. So I uninstalled nvm, and reinstalled nodejs by

sudo apt-get install curl
curl --silent --location https://deb.nodesource.com/setup_5.x | sudo bash -
sudo apt-get install nodejs

And now on my Ubuntu server, the node is back but npm wasn't, how to reinstall npm?

This is my command echo back: $ node -v 5.8.0

$ npm -v
-bash: /home/ubuntu/.nvm/versions/node/v5.8.0/bin/npm: No such file or directory

Upvotes: 1

Views: 722

Answers (2)

Jeff Tian
Jeff Tian

Reputation: 5893

Finally I found the solution:

curl http://npmjs.org/install.sh | sudo sh

Upvotes: 1

alexey
alexey

Reputation: 1411

I think this will help you:

sudo apt-get install --reinstall npm

Upvotes: 1

Related Questions