sh:1:节点:权限被拒绝

2024-05-09

尝试在 ubuntu 18.04 上运行此命令

npm install -g pngquant-bin

但我得到了这个错误,

[..................] | fetchMetadata: sill resolveWithNewModule [email protected] /cdn-cgi/l/email-protection checking installable status
npm WARN deprecated [email protected] /cdn-cgi/l/email-protection: 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

> [email protected] /cdn-cgi/l/email-protection 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! [email protected] /cdn-cgi/l/email-protection postinstall: `node lib/install.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] /cdn-cgi/l/email-protection 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

你知道如何处理这个问题吗? 我尝试了在此找到的所有解决方案articles https://github.com/imagemin/pngquant-bin/issues/78但没有成功。


遇到同样的错误sh: 1: node: Permission denied

所以这对我有用

npm config set user 0
npm config set unsafe-perm true
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

sh:1:节点:权限被拒绝 的相关文章

随机推荐