npm Community Forum (Archive)

The npm community forum has been discontinued.

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

I do not install npm packages, gives this error, please help.

ibra@DJAMLAY-PC:/mnt/e/video lesson/WebDesign Master/www-main/geektop$ npm i
Unhandled rejection Error: EACCES: permission denied, mkdir ‘/home/ibra/.npm/_cacache/index-v5/fa/23’

Unhandled rejection Error: EACCES: permission denied, mkdir ‘/home/ibra/.npm/_cacache/index-v5/36/15’

Unhandled rejection Error: EACCES: permission denied, mkdir ‘/home/ibra/.npm/_cacache/index-v5/2b/4d’

Unhandled rejection Error: EACCES: permission denied, mkdir ‘/home/ibra/.npm/_cacache/index-v5/76/5f’

Unhandled rejection Error: EACCES: permission denied, mkdir ‘/home/ibra/.npm/_cacache/index-v5/2b/2e’

Unhandled rejection Error: EACCES: permission denied, mkdir '/home/ibra/.npm/_cacache/index-v5/4e/da’602ms

Unhandled rejection Error: EACCES: permission denied, mkdir ‘/home/ibra/.npm/_cacache/index-v5/71/67’

Unhandled rejection Error: EACCES: permission denied, mkdir ‘/home/ibra/.npm/_cacache/index-v5/92/c5’

Unhandled rejection Error: EACCES: permission denied, mkdir ‘/home/ibra/.npm/_cacache/index-v5/74/8e’

Unhandled rejection Error: EACCES: permission denied, mkdir '/home/ibra/.npm/_cacache/index-v5/b5/84’rmission denied, m

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! /home/ibra/.npm/_logs/2019-08-19T15_02_02_997Z-debug.log


Your issue is a known problem with file ownership being broken by past uses of sudo with global installs. This was fixed in: Release: 6.10.2

The quick fix is:

sudo chown -R $USER ~/.npm

(And if you can upgrade npm, upgrade and run the chown again once more to avoid the problem happening again.)