我正在尝试将 nodeJs 安装到我的 Ubuntu 14.04 中以使用 GruntJs。
我已经阅读了有关 Ubuntu 的不同处理方式( 问题? ),所以这就是我为了安装它所做的:
sudo apt-get install npm
sudo npm install -g grunt-cli
之后输入 grunt 我得到了错误:
/usr/bin/env: node: No such file or directory
所以,我试过:
curl -sL https://deb.nodesource.com/setup | sudo bash -
sudo apt-get install -y nodejs
sudo apt-get update
再试一次,仍然得到错误,我试过了:
sudo add-apt-repository https://launchpad.net/~chris-lea/+archive/node.js/
sudo apt-get install -y nodejs
我收到了这条消息:
nodejs is already the newest version.
0 to upgrade, 0 to newly install, 0 to remove and 3 not to upgrade.
我确实尝试了清理以防万一:
sudo apt-get autoremove
但是不,错误仍然存在:当我输入 grunt 时,我仍然得到 /usr/bin/env: node: No such file or directory
我应该怎么办?
原文由 Rosamunda 发布,翻译遵循 CC BY-SA 4.0 许可协议
做一个符号链接解决了这个问题:
(我的感谢并对 bodokaiser 的回答 +1 投票)。