无法安装 NodeJs:/usr/bin/env: node: No such file or directory [英] Cannot install NodeJs: /usr/bin/env: node: No such file or directory
问题描述
我正在尝试将 nodeJs 安装到我的 Ubuntu 14.04 中以使用 GruntJs.
I'm trying to install nodeJs into my Ubuntu 14.04 in order to use GruntJs.
我读过关于 Ubuntu 不同的方式 这样做(问题?),所以这就是我所做的完成以安装它:
I've read about Ubuntu different way of doing it (issues?), so this is what I've done in order to install it:
sudo apt-get install npm
sudo npm install -g grunt-cli
之后输入 grunt 出现错误:
Typing grunt after that I've got the error:
/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
再试一次,还是出现错误,我试过了:
And trying again, and still getting the error, I've tried:
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.
我确实尝试了清理以防万一:
I did try a cleanup just in case:
sudo apt-get autoremove
但是不,错误仍然存在:当我输入 grunt 时,我仍然得到 /usr/bin/env: node: No such file or directory
But nope, the error is still there: when I type grunt I still get /usr/bin/env: node: No such file or directory
我该怎么办?
推荐答案
做一个符号链接可以解决这个问题:
Doing a symlink solves the issue:
ln -s /usr/bin/nodejs /usr/bin/node
(感谢并为 bodokaiser 的回答投了 +1 票).
(My thanks and +1 vote to bodokaiser's answer).
这篇关于无法安装 NodeJs:/usr/bin/env: node: No such file or directory的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!