当我在终端中写节点–version时,我看到:
-bash:/ usr / sbin / node:没有这样的文件或目录
我可以看到/ usr / sbin /目录下的节点,虽然。
写npm –version显示1.3.5
编写nodejs –version显示v0.10.15
此外,我可以看到/ usr / bin /目录中的节点。
那么,我如何获得节点工作?
此外,如果我使用zsh而不是bash,那么节点命令工作。
sudo ln -s `which nodejs` /usr/bin/node
或者如果你使用非标准的shell,只是硬编码的路径你找到与nodejs:
sudo ln -s /usr/bin/nodejs /usr/bin/node
稍后编辑
我在您发布的链接中找到了此解释
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. 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.
稍后编辑
这是一段时间,因为我回答了这一点。虽然我在这里发布的解决方案为我工作了好几次,用户已经报告了更多的解决方案在意见:
从@ user229115
sudo update-alternatives –install / usr / bin / node node / usr / bin / nodejs 10
从AskUbuntu(用户leftium)
sudo apt-get --purge remove node sudo apt-get --purge remove nodejs sudo apt-get install nodejs
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。