sudo * 提示 command not found 解决打赏
linux下经常遇到使用非root用户安装软件,使用sudo时提示找不到命令。
比如使用nodejs时候,出现
sudo: node: command not found sudo: npm: command not found
很多文章说export临时修改环境变量或者直接sudo后chown指定命令所在文件夹的所有者,但是我们通常是在非root用户下使用,所以只需在root用户下增加部分软连接即可
sudo ln -s /usr/local/nodejs/bin/node /usr/bin/node sudo ln -s /usr/local/nodejs/lib/node /usr/lib/node sudo ln -s /usr/local/nodejs/bin/npm /usr/bin/npm sudo ln -s /usr/local/nodejs/bin/node-waf /usr/bin/node-waf
简单记录一下,希望对刚接触linux的同学有一定帮助
- 固定链接:https://www.poorren.com/sudo-prompt-command-not-found-solved
- 文章标签:CentOS,linux,node,NodeJS,npm
- 扫二维码:sudo * 提示 command not found 解决
- 版权所有:除"转载分享"分类外,未经注明,均为原创、整理,转载请注明出处。
支持老大~~~~~~~~
Hello I am so delighted I found your site,
I really found you by accident, while I was browsing on Digg for something else,
Nonetheless I am here now and would just like to say many thanks for a remarkable post
and a all round interesting blog (I also love the theme/design),
I don’t have time to browse it all at the moment
but I have bookmarked it and also added in your RSS feeds, so when I have time I will be back
to read more, Please do keep up the awesome jo.