On npm install: Unhandled rejection Error: EACCES: permission denied

后端 未结 16 782
抹茶落季
抹茶落季 2020-12-02 03:51

I have managed to corrupt my npm install, and whenever I try to install packages using npm install, I receive error messages along these lines:

相关标签:
16条回答
  • 2020-12-02 04:18

    change ownership

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

    worked for as i installed package using sudo

    0 讨论(0)
  • 2020-12-02 04:19

    Simply run on terminal : sudo chown -R $(whoami) ~/.npm

    This worked for me !!

    0 讨论(0)
  • 2020-12-02 04:21

    Restore ownership of the user's npm related folders, to the current user, like this:

    sudo chown -R $USER:$GROUP ~/.npm
    sudo chown -R $USER:$GROUP ~/.config
    
    0 讨论(0)
  • 2020-12-02 04:22

    Simply do sudo npm cache clean --force --unsafe-perm and npm i will go normally.

    0 讨论(0)
提交回复
热议问题