webpack npm 报错问题集合

全局安装npm包报错 Error: EACCES: permission denied, mkdir '/Users/lyc/.npm/sentry-cli'

 $ sudo npm i -g @sentry/cli
 
    /usr/local/bin/sentry-cli -> /usr/local/lib/node_modules/@sentry/cli/bin/sentry-cli
    
    > @sentry/cli@1.47.1 install /usr/local/lib/node_modules/@sentry/cli
    > node scripts/install.js
    
    Error: EACCES: permission denied, mkdir '/Users/lyc/.npm/sentry-cli'
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! @sentry/cli@1.47.1 install: `node scripts/install.js`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the @sentry/cli@1.47.1 install 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!     /Users/lyc/.npm/_logs/2019-08-04T00_15_56_196Z-debug.log
    

权限问题,解决方案: --unsafe-perm=true --allow-root

$ sudo npm i -g @sentry/cli --unsafe-perm=true --allow-root
    原文作者:旅图灬
    原文地址: https://segmentfault.com/a/1190000019964783
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞