An error with NPM itself

What I Wanted to Do

Run npm i on this repository:

git clone https://github.com/superflycss/utilities-effects

What Happened Instead

ole@mki:~/SuperflyCSS/utilities-effects$ npm i
Unhandled rejection Error: EACCES: permission denied, mkdir β€˜/home/ole/.npm/_cacache/content-v2/sha512/0b/3d’

Unhandled rejection Error: EACCES: permission denied, mkdir β€˜/home/ole/.npm/_cacache/index-v5/37/07’ 6ms

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/ole/.npm/_logs/2019-05-15T11_40_27_904Z-debug.log

Reproduction Steps

git clone https://github.com/superflycss/utilities-effects
cd utilities-effects
npm i

Details

Platform Info

$ npm --versions
ole@mki:~/SuperflyCSS/utilities-effects$ npm --versions
{
  '@superflycss/utilities-effects': '2.1.3',
  npm: '6.9.0',
  ares: '1.15.0',
  brotli: '1.0.7',
  cldr: '35.1',
  http_parser: '2.8.0',
  icu: '64.2',
  llhttp: '1.1.3',
  modules: '72',
  napi: '4',
  nghttp2: '1.38.0',
  node: '12.2.0',
  openssl: '1.1.1b',
  tz: '2019a',
  unicode: '12.1',
  uv: '1.28.0',
  v8: '7.4.288.21-node.17',
  zlib: '1.2.11'
}

<!-- paste output here -->
$ node -p process.platform
ole@mki:~/SuperflyCSS/utilities-effects$ node -p process.platform
linux


<!-- paste output here -->

Some relevant info: https://stackoverflow.com/questions/56138742/npm-i-fails-after-updating-node

2019-05-15T11_40_27_904Z-debug.log (25.6 KB)

Hello. Same problem here:

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! C:\Users\FlorianCastelain\AppData\Roaming\npm-cache_logs\2019-05-15T12_33_27_900Z-debug.log

2019-05-15T12_33_27_900Z-debug.log (346.0 KB)

npm 6.4.1
node 10.15.1
Windows 10

It’s starting to happen to all my repositories now …

Tried clearing the cache and got this (I only do NPM operations as a local user):

ole@mki:~/SuperflyCSS/component-site$ npm cache clear --force
npm WARN using --force I sure hope you know what you are doing.
npm ERR! path /home/ole/.npm/_cacache/index-v5/37/d7
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall rmdir
npm ERR! Error: EACCES: permission denied, rmdir β€˜/home/ole/.npm/_cacache/index-v5/37/d7’
npm ERR! [OperationalError: EACCES: permission denied, rmdir β€˜/home/ole/.npm/_cacache/index-v5/37/d7’] {
npm ERR! cause: [Error: EACCES: permission denied, rmdir β€˜/home/ole/.npm/_cacache/index-v5/37/d7’] {
npm ERR! errno: -13,
npm ERR! code: β€˜EACCES’,
npm ERR! syscall: β€˜rmdir’,
npm ERR! path: β€˜/home/ole/.npm/_cacache/index-v5/37/d7’
npm ERR! },
npm ERR! isOperational: true,
npm ERR! stack: β€˜Error: EACCES: permission denied, rmdir ’ +
npm ERR! "’/home/ole/.npm/_cacache/index-v5/37/d7’",
npm ERR! errno: -13,
npm ERR! code: β€˜EACCES’,
npm ERR! syscall: β€˜rmdir’,
npm ERR! path: β€˜/home/ole/.npm/_cacache/index-v5/37/d7’
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).

npm ERR! A complete log of this run can be found in:
npm ERR! /home/ole/.npm/_logs/2019-05-15T13_58_54_041Z-debug.log

Also tried downgrading NPM to version 6.5.0 and that did not work either …

Stackoverflow cross reference: https://stackoverflow.com/questions/56138742/npm-i-fails-after-updating-node

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.

3 Likes

Hi. I have not tested your work around yet. But is it working with non global install?

@Florian
Yes. It fixes the ownership so that non-global installs work as expected.

Arf. Unavaible on Windows. And I did not manage to find an equivalent :S

1 Like

Sorry @Florian, my advice was for the Linux/Mac users.

In logs I have at the end: http fetch POST 503 https://registry.npmjs.org/-/npm/v1/security/audits/quick 13856ms

Could it be linked to https://status.npmjs.org/incidents/1jdmllbx0q59 ?

Edit: Upgrading from npm 6.4.1 to 6.9.0 seem to have fixe my problem

Thanks for update @Florian, glad you have it sorted.

This worked! Thank you so much!

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