npm throws EACCES error on installation of Angular CLI

后端 未结 9 603
没有蜡笔的小新
没有蜡笔的小新 2020-12-11 15:34

I am unable to install Angular Cli globally through npm. I keep getting this error when I run npm install -g @angular/cli on macOS:

npm ERR! nod         


        
9条回答
  •  猫巷女王i
    2020-12-11 15:46

    Important Note: My answer has vulnerability issues. Giving permissions as root. Use it only after analyzing the effect on your system.

    After using

    sudo npm install -g PACKAGE-NAME --unsafe-perm=true --allow-root

    I still had issues creating a project with the CLI. these commands, allowing permissions, fixed it:

    sudo chown -R $USER:$GROUP ~/.npm

    sudo chown -R $USER:$GROUP ~/.config

提交回复
热议问题