Bug found with NPM

What I Wanted to Do

Run $ npm audit fix

What Happened Instead

Unhandled rejection Error: EACCES: permission denied, rename β€˜/Users/simonbolus/.npm/_cacache/tmp/de030842’ -> β€˜/Users/simonbolus/.npm/_cacache/content-v2/sha512/78/08/d4470cfc385d74652835915afe209e8580dd62bae758730c140aac4c3a0f18b4c0c3825be944054e5ba704fc56103f80d0a7df6da5f170914a2527714ea4’

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/simonbolus/.npm/_logs/2019-03-22T15_49_38_788Z-debug.log

Reproduction Steps

Run $ npm audit fix


Just installed $ npm install --save angular-screenfull

0 info it worked if it ends with ok
1 verbose cli [ β€˜/usr/local/bin/node’, β€˜/usr/local/bin/npm’, β€˜audit’, β€˜fix’ ]
2 info using npm@6.8.0
3 info using node@v8.11.4
4 verbose npm-session 1a405d31c98cf8ff
5 timing audit submit Completed in 842ms
6 http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/audits 841ms
7 timing audit body Completed in 0ms
8 verbose audit installing [ β€˜karma@4.0.1’,
8 verbose audit β€˜@angular-devkit/build-angular>postcss-loader>postcss-load-config>cosmiconfig>js-yaml@3.13.0’,
8 verbose audit β€˜karma-coverage-istanbul-reporter>istanbul-api>js-yaml@3.13.0’,
8 verbose audit β€˜tslint>js-yaml@3.13.0’ ]
9 silly install loadCurrentTree
10 silly install readLocalPackageData
11 timing npm Completed in 2830ms
12 error cb() never called!
13 error This is an error with npm itself. Please report this error at:
14 error https://npm.community

Platform Info

$ npm --versions

npm: '6.8.0',
  ares: '1.10.1-DEV',
  cldr: '32.0',
  http_parser: '2.8.0',
  icu: '60.1',
  modules: '57',
  napi: '3',
  nghttp2: '1.32.0',
  node: '8.11.4',
  openssl: '1.0.2p',
  tz: '2017c',
  unicode: '10.0',
  uv: '1.19.1',
  v8: '6.2.414.54',
  zlib: '1.2.11' 

$ node -p process.platform
<!-- paste output here -->


The short version is run this to fix the ownership, then try your command 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.