0

i am learning to use the express framework for nodeJs. i am having issues installing express using npm install express --save

Unhandled rejection Error: EACCES: permission denied, mkdir '/Users/akandegeorge/.npm/_cacache/index-v5/37/92'

Unhandled rejection Error: EACCES: permission denied, mkdir '/Users/akandegeorge/.npm/_cacache/index-v5/22/9a'

Unhandled rejection Error: EACCES: permission denied, mkdir '/Users/akandegeorge/.npm/_cacache/index-v5/06/5a'

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://npm.community>

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/akandegeorge/.npm/_logs/2019-08-18T18_13_54_120Z-debug.log
ThomasThiebaud
  • 11,331
  • 6
  • 54
  • 77
  • Possible duplicate: [on-npm-install-unhandled-rejection-error-eacces-permission-denied](https://stackoverflow.com/questions/50639690/on-npm-install-unhandled-rejection-error-eacces-permission-denied) – Peter Aug 19 '19 at 17:44

2 Answers2

0

This issue occurs on MacOS when the permissions on your home folder are wrong and are preventing npm from creating files on your disk. You can fix this by resetting your home folder's permissions.

ColonelHedgehog
  • 438
  • 3
  • 18
0

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

then try

sudo npm install express --save
Bivin Vinod
  • 2,210
  • 1
  • 12
  • 15