简体   繁体   English

命令 node -v 显示 bash: /usr/local/bin/node: No such file or directory

[英]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.

相关问题 Angular:bash: /usr/local/lib/node_modules/@angular/cli/bin/ng: 没有这样的文件或目录 - Angular:bash: /usr/local/lib/node_modules/@angular/cli/bin/ng: No such file or directory Windows上的ubuntu上的bash运行npm命令给出错误“ / usr / bin / env:节点:没有这样的文件或目录” - bash on ubuntu on windows run npm command gives error “/usr/bin/env: node: No such file or directory” node.js和express -bash:/ usr / bin / express:没有这样的文件或目录 - node.js and express -bash: /usr/bin/express: No such file or directory -bash: /usr/local/bin/npm: 没有那个文件或目录 - -bash: /usr/local/bin/npm: No such file or directory node -bash:/ usr / sbin / node:没有这样的文件或目录 - node -bash: /usr/sbin/node: No such file or directory Node.js bash:/ usr / local / bin / node:权限被拒绝 - Node.js bash: /usr/local/bin/node: Permission denied / usr / bin / env:节点--harmony:没有这样的文件或目录 - /usr/bin/env: node --harmony: No such file or directory Jenkins - /usr/bin/env: 节点:没有这样的文件或目录 - Jenkins - /usr/bin/env: node: No such file or directory 打包节点bash CLI以从/ usr / local / bin /文件夹执行 - Packing a node bash CLI for execution from the /usr/local/bin/ folder 永远节点/ usr / bin / env:node:没有这样的文件或目录 - Node forever /usr/bin/env: node: No such file or directory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM