Npm install failed “cannot run in wd”

来源:互联网 发布:儿童摄影网络拉单公司 编辑:程序博客网 时间:2024/04/28 01:55

使用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.

0 0
原创粉丝点击