我想在Debian 9上安装npm。
我已经尝试过以下步骤:
apt-get install nodejs
已经完全安装并且 nodejs -v
的结果是: v4.8.2
。
但是当尝试运行npm时,会出现错误:
bash: npm: command not found
根据我的搜索,我尝试了其他方法:
基于这个指南:https://www.godaddy.com/help/install-nodejs-ubuntu-17395,我尝试了:
sudo apt-get install npm
结果:
E: Package 'npm' has no installation candidate
根据我之前尝试的一份指南:
wget https://npmjs.org/install.sh
sudo chmod +x install.sh
sudo ./install.sh
结果:
npm cannot be installed without node.js.
当然,我已经安装了Node.js。我还尝试了这种方法:
curl --silent --location https://deb.nodesource.com/setup_0.12 | sudo bash -
sudo apt-get update
sudo apt-get install --yes nodejs
It says:
nodejs is already the newest version (4.8.2~dfsg-1).
我该怎么办?