Search code examples
npmnpm-installexpress-generator

npm EACCES error again after fixing it


I was having an issue where I couldn't use npm to install things globally and I fixed it by following the instructions here and making a .npm-global directory. My computer restarted and updated software and now it doesn't work again and I redid the instructions but its not helping. Any idea what could be happening?

$ npm install -g express-generator
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied,

Solution

  • The tip at the bottom is actually more useful.

    "If you are using npm version 5.2 or greater, explore npx as an alternative way to run global commands, especially if you just need a command occassionally. Click here to read an excellent article about npx."

    npx works great. https://docs.npmjs.com/getting-started/fixing-npm-permissions