数码资讯
Npm install failed “cannot run in wd”
选购提示
关注价格、性能、续航、售后和真实使用场景,理性比较后再下单。
使用npm install时,出现了 “cannot run in wd”等字样时,是安装出错了。
需要加上–unsafe-perm参数,完整如下:
npm install --unsafe-perm
或是在package.json中添加:
"config": { "unsafe-perm":true }
官方的解释为:
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.
声明:本文内容用于数码产品信息整理与选购参考,具体价格、库存、售后政策以官方渠道和电商页面实时信息为准。