美文网首页
Jenkins 前端打包 npm 报错 EACCES: perm

Jenkins 前端打包 npm 报错 EACCES: perm

作者: 前浪浪奔浪流 | 来源:发表于2024-03-20 16:51 被阅读0次

解决办法:

添加--unsafe-perm 参数,如

npm install  --unsafe-perm

或者再来个淘宝镜像

npm install --registry=https://registry.npmmirror.com  --unsafe-perm

说明:npm会有生命周期,某个包会有生命周期来执行一些东西,安全起见会自动降级导致没有权限执行一些操作,通过--unsafe-perm参数来解锁该限制。

一劳永逸的方法:

npm config set unsafe-perm(针对当前用户的)   

npm config -g set unsafe-perm(全局的)

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

将后边加上以上参数完美解决!

转载自:https://www.cnblogs.com/lgj8/p/14522375.html

相关文章

网友评论

      本文标题:Jenkins 前端打包 npm 报错 EACCES: perm

      本文链接:https://www.haomeiwen.com/subject/asvxtjtx.html