节点:拒绝许可。如何修复?

发布于 2025-02-10 13:38:48 字数 805 浏览 2 评论 0原文

Nodejs的权限显示为空白。我不确定它是如何改变的。我无法删除或启动节点。如何解决这个问题?

/usr/bin# ls -la | grep node
lrwxrwxrwx  1 root root          45 Feb  1 14:40 corepack -> ../lib/node_modules/corepack/dist/corepack.js
----------  1 root root    75421096 Feb  1 08:05 node
lrwxrwxrwx  1 root root           4 Jun 26 00:44 nodejs -> node
lrwxrwxrwx  1 root root          38 Feb  1 14:40 npm -> ../lib/node_modules/npm/bin/npm-cli.js
lrwxrwxrwx  1 root root          38 Feb  1 14:40 npx -> ../lib/node_modules/npm/bin/npx-cli.js
/usr/bin# node
-bash: /usr/bin/node: Permission denied
/usr/bin# chmod -v 777 node
chmod: changing permissions of 'node': Operation not permitted
failed to change mode of 'node' from 0000 (---------) to 0777 (rwxrwxrwx)

The permission for nodejs is showing blank. I am not sure how it got changed. I am not able to remove or start node. How to fix this?

/usr/bin# ls -la | grep node
lrwxrwxrwx  1 root root          45 Feb  1 14:40 corepack -> ../lib/node_modules/corepack/dist/corepack.js
----------  1 root root    75421096 Feb  1 08:05 node
lrwxrwxrwx  1 root root           4 Jun 26 00:44 nodejs -> node
lrwxrwxrwx  1 root root          38 Feb  1 14:40 npm -> ../lib/node_modules/npm/bin/npm-cli.js
lrwxrwxrwx  1 root root          38 Feb  1 14:40 npx -> ../lib/node_modules/npm/bin/npx-cli.js
/usr/bin# node
-bash: /usr/bin/node: Permission denied
/usr/bin# chmod -v 777 node
chmod: changing permissions of 'node': Operation not permitted
failed to change mode of 'node' from 0000 (---------) to 0777 (rwxrwxrwx)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

陌路终见情 2025-02-17 13:38:48

对我来说,将节点重新安装NVM解决了问题:

安装NVM
NVM安装14
NVM使用14

For me, re-installing node with NVM solved the issue:

Install nvm
nvm install 14
nvm use 14

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文