CentOS7-运维-npm install 问题{ Error: EACCES: permission denied, mkdir }

  • Centos7,工程执行npm install,遇到的问题: 

  • 官网解释:

If npm was invoked with root privileges, then it will change the uid to the user account or uid specified by the user config, which defaults to nobody. Set the unsafe-perm flag to run scripts with root privileges.

  • 处理方案:
    • 在命令结尾加 --unsafe-perm: npm install --unsafe-perm
    • 或者在package.json中添加:
"config": {

    "unsafe-perm":true

}

 

你可能感兴趣的:(centos7,CentOS7)