Node.js   发布时间:2022-04-24  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了node.js – sh:1:node:权限被拒绝大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
试图在ubuntu 18.04上运行此命令

npm install -g pngquant-bin

但我得到了这个错误,

[..................] | fetchMetadata: sill resolveWithNewModule npm-conf@1.1.3 checking installable status
npm WARN deprecated gulp-util@3.0.8: gulp-util is deprecated - replace it,following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
/root/.nvm/versions/node/v10.8.0/bin/pngquant -> /root/.nvm/versions/node/v10.8.0/lib/node_modules/pngquant-bin/cli.js

> pngquant-bin@5.0.0 posTinstall /root/.nvm/versions/node/v10.8.0/lib/node_modules/pngquant-bin
> node lib/install.js

sh: 1: node: Permission denied
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! pngquant-bin@5.0.0 posTinstall: `node lib/install.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the pngquant-bin@5.0.0 posTinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-08-12T18_08_02_197Z-debug.log

你知道怎么处理吗?

请不要downVote ..

我尝试了在这articles中找到的每个解决方案,但没有成功,这就是原因

我粘贴在终端显示内容.

解决方法

错误消息告诉您所有您需要知道的信息.您缺少足够的权限来执行此安装,或者至少要全局安装(使用-g选项).错误消息告诉您.

以其他用户身份运行,使用sudo或仅在本地安装.

大佬总结

以上是大佬教程为你收集整理的node.js – sh:1:node:权限被拒绝全部内容,希望文章能够帮你解决node.js – sh:1:node:权限被拒绝所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。