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

后端 未结 16 942
抹茶落季
抹茶落季 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:00

    Try using this: On the command line, in your home directory, create a directory for global installations:

    mkdir ~/.npm-global
    

    Configure npm to use the new directory path:

    npm config set prefix '~/.npm-global'
    

    In your preferred text editor, open or create a ~/.profile file and add this line:

    export PATH=~/.npm-global/bin:$PATH
    

    On the command line, update your system variables:

    source ~/.profile
    

    Now use npm install it should work.

提交回复
热议问题