npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

Getting error while installing npm lite server through command line in ubuntu system

biharianna@BihariAnna:/opt/lampp/htdocs/git-test$ npm install lite-server --save-dev
Unhandled rejection Error: EACCES: permission denied, mkdir ‘/home/biharianna/.npm/_cacache/index-v5/66/bb’

Unhandled rejection Error: EACCES: permission denied, mkdir ‘/home/biharianna/.npm/_cacache/index-v5/55/f5’

npm ERR! cb() never called!

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


Hi @k.gaurav429025! There is an open issue with installing global packages using sudo leaving behind files with the wrong ownership.

The short version is run this to fix the ownership, then try your install again:

sudo chown -R $(whoami) ~/.npm
npm install lite-server --save-dev

The long version and canonical bug is: Global installs (sudo npm i -g) fail on Mac after 6.5 upgrade. Works fine after 6.4.1 downgrade.