You need to manually create a symlink /usr/bin/node
.(您需要手动创建符号链接/usr/bin/node
。)
Shortcut for bash compatible shells:(bash兼容shell的快捷方式:)
sudo ln -s `which nodejs` /usr/bin/node
Or if you use non-standard shells, just hardcode the path you find with which nodejs
:(或者,如果您使用非标准shell,只需使用which nodejs
对您找到的路径进行硬编码:)
sudo ln -s /usr/bin/nodejs /usr/bin/node
Later edit(稍后编辑)
I found this explanation in the link you posted(我在你发布的链接中找到了这个解释)
There is a naming conflict with the node package (Amateur Packet Radio Node Program), and the nodejs binary has been renamed from node to nodejs.(与节点包(业余分组无线电节点程序)存在命名冲突,并且nodejs二进制文件已从节点重命名为nodejs。) You'll need to symlink /usr/bin/node to /usr/bin/nodejs or you could uninstall the Amateur Packet Radio Node Program to avoid that conflict.(您需要将/ usr / bin / node符号链接到/ usr / bin / nodejs,或者您可以卸载业余数据包无线电节点程序以避免这种冲突。)
Later later edit(稍后编辑)
It's been a while since I answered this.(我回答这个问题已经有一段时间了。) Although the solution I posted up here worked for me several times, users have reported a few more solutions within the comments:(虽然我在这里发布的解决方案多次为我工作,但用户在评论中报告了更多解决方案:)
From @user229115(来自@ user229115)
sudo update-alternatives --install /usr/bin/node node /usr/bin/nodejs 10
From AskUbuntu (user leftium)(来自AskUbuntu(用户leftium))
sudo apt-get --purge remove node
sudo apt-get --purge remove nodejs
sudo apt-get install nodejs
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…