Error: EACCES: permission denied

后端 未结 23 2339
醉梦人生
醉梦人生 2020-11-29 19:04

I run npm install lodash but it throws Error: EACCES: permission denied error. I know it is permission issue but as far as I know, sudo permission

23条回答
  •  眼角桃花
    2020-11-29 20:03

    I solved this issue by changing the permission of my npm directory. I went to the npm global directory for me it was at

    /home/
    

    I went to this directory by entering this command

    cd /home/
    

    and then changed the permission of .npm folder by entering this command.

    sudo chmod -R 777 ".npm"
    

    It worked like a charm to me. But there is a security flaw with this i.e your global packages directory is accessible to all the levels.

提交回复
热议问题