[英]Command node -v shows bash: /usr/local/bin/node: No such file or directory
I have a non working node on my raspberry pi 4 (buster).我的树莓派 4(buster)上有一个非工作节点。 :(
:(
npm -v
shows version 6.14.5 and nodejs -v
shows v10.21.0 but node -v
shows only "bash: /usr/local/bin/node: No such file or directory" npm -v
显示版本 6.14.5 和nodejs -v
显示 v10.21.0 但node -v
仅显示“bash:/usr/local/bin/node:没有这样的文件或目录”
But a file named /usr/local/bin/node is there.但是有一个名为 /usr/local/bin/node 的文件。
The Command命令
n latest
shows节目
installing : node-v14.6.0
mkdir : /usr/local/n/versions/node/14.6.0
fetch : https://nodejs.org/dist/v14.6.0/node-v14.6.0-linux-arm64.tar.xz
/usr/local/bin/n: line 633: /usr/local/bin/node: No such file or directory
installed : (with npm 6.14.6)
I had the same issue and this is how I solved it我有同样的问题,这就是我解决它的方法
Remove the files in usr/local/bin/node using this command sudo rm -rf /usr/local/bin/node *.使用此命令删除usr/local/bin/node中的文件sudo rm -rf /usr/local/bin/node *. You could optionally choose to manually remove npx, n or whichever node related package that you've installed
您可以选择手动删除 npx、n 或您已安装的任何与节点相关的 package
Run sudo apt install nodejs and then check the version using node -v运行sudo apt install nodejs然后使用node -v检查版本
Run sudo apt install npm then npm -v运行sudo apt install npm然后npm -v
After that, run curl -o-https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh |之后,运行curl -o-https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash then restart the terminal
bash然后重启终端
Finally run nvm install 16最后运行nvm install 16
This should solve your issue, it did for me!这应该可以解决您的问题,它对我有用!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.