an erro when I try "npm install"

Unhandled rejection Error: EACCES: permission denied, open ‘/home/firas/.npm/_cacache/tmp/cb6d98f3’

npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning EACCES: EACCES: permission denied, open ‘/home/firas/.npm/_cacache/tmp/54623fca’
npm WARN registry Using stale data from https://registry.npmjs.org/ due to a request error during revalidation.
Unhandled rejection Error: EACCES: permission denied, open ‘/home/firas/.npm/_cacache/tmp/91342325’

Unhandled rejection Error: EACCES: permission denied, open ‘/home/firas/.npm/_cacache/tmp/faaff579’

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/firas/.npm/_logs/2019-03-21T17_46_01_634Z-debug.log

(Posts to #bugs must follow the template and supply additional information. Posts to #support are more freeform, and I have moved your topic there.)

Thanks. 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

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.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.