当前位置:   article > 正文

解决 npm install Error: EACCES: permission denied, mkdir node_modules/gifsicle/

解决 npm install Error: EACCES: permission denied, mkdir node_modules/gifsicle/

1. 原因CentOS jenkins自动构建服务 使用root账号执行npn install 指令,报错如下

  1. > gifsicle@4.0.1 postinstall /***//node_modules/gifsicle
  2. > node lib/install.js
  3. ⚠ EACCES: permission denied, open '/***//node_modules/gifsicle/vendor/gifsicle'
  4. ⚠ gifsicle pre-build test failed
  5. ℹ compiling from source
  6. Error: EACCES: permission denied, mkdir '/***//node_modules/gifsicle/9341d536-a2fb-4d27-b4de-c1cf6ba79f6b'
  7. > optipng-bin@6.0.0 postinstall /***//node_modules/optipng-bin
  8. > node lib/install.js
  9. ⚠ EACCES: permission denied, open '/***//node_modules/optipng-bin/vendor/optipng'
  10. ⚠ optipng pre-build test failed
  11. ℹ compiling from source
  12. Error: EACCES: permission denied, mkdir '/***//node_modules/optipng-bin/5ca0582d-e98e-415f-9043-9b1927de9804'
  13. > pngquant-bin@5.0.2 postinstall /***//node_modules/pngquant-bin
  14. > node lib/install.js
  15. ⚠ EACCES: permission denied, open '/***//node_modules/pngquant-bin/vendor/pngquant'
  16. ⚠ pngquant pre-build test failed
  17. ℹ compiling from source
  18. Error: pngquant failed to build, make sure that libpng-dev is installed

2.  调整构建指令

npm install --unsafe-perm=true --allow-root

错误解决。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/180966
推荐阅读
相关标签
  

闽ICP备14008679号