我正在尝试将 nodeJs 安装到我的 Ubuntu 14.04 中以使用 GruntJs。
我读过 Ubuntu different way这样做(issues?),所以这是我为了安装它所做的:
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
我该怎么办?
最佳答案
做一个符号链接(symbolic link)解决了这个问题:
ln -s /usr/bin/nodejs /usr/bin/node
(感谢并为 bodokaiser's answer +1 投票)。
关于node.js - 无法安装 NodeJs :/usr/bin/env: node: No such file or directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26320901/