linux 下 root 权限执行 npm install 报错:Error:EACCES:permission denied ‘xxx‘?

简介: linux 下 root 权限执行 npm install 报错:Error:EACCES:permission denied ‘xxx‘?

问题


最近测试在 linux 下使用 root 权限执行 npm install 报错了,错误如下:

be934e870f464c7db71f857493a817c7.png


解决


在执行命令后面添加参数: --unsafe-perm=true --allow-root

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


原因


unsafe-perm


   Default: false if running as root, true otherwise

   Type: Boolean

Set to true to suppress the UID/GID switching when running package scripts. If set explicitly to false, then installing as a non-root user will fail.


原因可以参考下面的文章:


使用root用户npm install



目录
相关文章
|
18天前
|
网络安全 计算机视觉
【node】 npm install 报错:code 128
【node】 npm install 报错:code 128
45 1
|
18天前
|
Linux
npm install 报错ERESOLVE unable to resolve dependency tree
npm install 报错ERESOLVE unable to resolve dependency tree
21 0
|
18天前
|
Linux 网络安全
linux免密登录报错 Bad owner or permissions on /etc/ssh/ssh_config.d/05-redhat.conf
linux免密登录报错 Bad owner or permissions on /etc/ssh/ssh_config.d/05-redhat.conf
36 1
|
18天前
|
Go
ChaosBlade 1.7.3 make build_linux 有个报错 不知大家遇到过没
【2月更文挑战第23天】ChaosBlade 1.7.3 make build_linux 有个报错 不知大家遇到过没
30 1
|
18天前
|
安全 Shell Linux
【Shell 命令集合 系统管理 】Linux 以超级用户(root)的身份执行特权命令 sudo命令 使用指南
【Shell 命令集合 系统管理 】Linux 以超级用户(root)的身份执行特权命令 sudo命令 使用指南
83 1
|
11天前
Receiving ASM traces for errors: ORA-27090, LINUX-X86_64 ERROR: 17
Receiving ASM traces for errors: ORA-27090, LINUX-X86_64 ERROR:
22 7
|
13天前
|
Linux 固态存储
linux ext4-fs error,[求助]EXT4-fs error (device sdb4) ext4_find_entry
linux ext4-fs error,[求助]EXT4-fs error (device sdb4) ext4_find_entry
linux ext4-fs error,[求助]EXT4-fs error (device sdb4) ext4_find_entry
|
18天前
|
Linux Shell 数据安全/隐私保护
|
18天前
npm报错:npm ERR! code ECONNREFUSED npm ERR! errno ECONNREFUSED,npm ERR! npm ERR! If you are behind a
npm报错:npm ERR! code ECONNREFUSED npm ERR! errno ECONNREFUSED,npm ERR! npm ERR! If you are behind a
|
18天前
|
弹性计算 Dubbo Serverless
Serverless 应用引擎操作报错合集之阿里函数计算中配置完fc,出现‘Function instance exited unexpectedly(code 1, message:operation not permitted) with start command 'npm run start '. 报错如何解决
Serverless 应用引擎(SAE)是阿里云提供的Serverless PaaS平台,支持Spring Cloud、Dubbo、HSF等主流微服务框架,简化应用的部署、运维和弹性伸缩。在使用SAE过程中,可能会遇到各种操作报错。以下是一些常见的报错情况及其可能的原因和解决方法。