sh: 1: node: Permission denied

前端 未结 7 537
闹比i
闹比i 2021-02-01 03:24

Tried to run this command on ubuntu 18.04

npm install -g pngquant-bin

but I got this error,

[..................] | fetchMetada         


        
相关标签:
7条回答
  • 2021-02-01 04:11

    in fact, npm can't use root account to install anything. if you use root account, npm will create a non-permission account to install. in this case, if the package need to execute writeFile or other operation which need permission, the error node: Permission denied will be raised.

    so, you can choose optional arbitrary under:

    • npm install xxx --unsafe-perm
    • npm config set unsafe-perm true
    • create high-permission account dedicate to execute npm install
    0 讨论(0)
提交回复
热议问题