Error: EACCES: permission denied

后端 未结 23 2214
醉梦人生
醉梦人生 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 19:39

    First install without -g (global) on root. After try using -g (global) It worked for me.

    0 讨论(0)
  • 2020-11-29 19:40

    Execute these commands and issue will be solved!

    sudo chmod -R 777 /usr/local/bin
    sudo chmod -R 777 /usr/local/lib/node_modules
    
    0 讨论(0)
  • 2020-11-29 19:42

    LUBUNTU 19.10 / Same issue running: $ npm start

    dump: Error: EACCES: permission denied, open '/home/simon/xxx/pagebuilder/resources/scripts/registration/node_modules/.cache/@babel/register/.babel.7.4.0.development.json' at Object.fs.openSync (fs.js:646:18) at Object.fs.writeFileSync (fs.js:1299:33) at save (/home/simon/xxx/pagebuilder/resources/scripts/registration/node_modules/@babel/register/lib/cache.js:52:15) at _combinedTickCallback (internal/process/next_tick.js:132:7) at process._tickCallback (internal/process/next_tick.js:181:9) at Function.Module.runMain (module.js:696:11) at Object. (/home/simon/xxxx/pagebuilder/resources/scripts/registration/node_modules/@babel/node/lib/_babel-node.js:234:23) at Module._compile (module.js:653:30) at Object.Module._extensions..js (module.js:664:10) at Module.load (module.js:566:32)

    Looks like my default user (administrator) didn't have rights on node-module directories.

    This fixed it for me!

    $ sudo chmod a+w node_modules -R ## from project root

    0 讨论(0)
  • 2020-11-29 19:42

    On Windows it ended up being that the port was already in use by IIS.

    Stopping IIS (Right-click, Exit), resolved the issue.

    0 讨论(0)
  • 2020-11-29 19:44

    A related issue:

    Wasted 3 hours spanning several days.

    On a AWS EC2 machine, below worked:

    sudo chown -R $(whoami) /home/ubuntu/.cache
    sudo chown -R $(whoami) /home/ubuntu/.config
    sudo chown -R $(whoami) /home/ubuntu/.local
    sudo chown -R $(whoami) /home/ubuntu/.npm
    sudo chown -R $(whoami) /home/ubuntu/.pm2
    

    Hope that helps.

    0 讨论(0)
  • 2020-11-29 19:45

    I had problem on Linux. I wrote

    chown -R myUserName ./* 

    in my project folder.

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