npm Community Forum (Archive)

The npm community forum has been discontinued.

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

npm fails to install node red dashboard

i want to install node red dashboard and other palette on my mac. But it show the unter information.
Unhandled rejection Error: EACCES: permission denied, mkdir ‘/Users/zhangzhang/.npm/_cacache/index-v5/45/fb’

Unhandled rejection Error: EACCES: permission denied, mkdir ‘/Users/zhangzhang/.npm/_cacache/index-v5/21/11’

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/zhangzhang/.npm/_logs/2019-08-30T11_58_56_483Z-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

If you are able to update npm to avoid the problem happening again, upgrade npm and then run the chown again one last time to fix any issues from the upgrade itself.