如何带回 `npm`?

How to bring `npm` back?

我通过 nvmUbuntu 服务器上安装了 nodejs,发现 jenkins 任务存在问题。所以我卸载了 nvm,然后

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

现在在我的 Ubuntu 服务器上,node 回来了,但 npm 没有,如何重新安装 npm

这是我的命令回显: $节点-v 5.8.0

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

我认为这对你有帮助:

sudo apt-get install --reinstall npm

终于找到了解决办法:

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