An error with NPM itself

(Ole Ersoy) #1

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 -->
(Ole Ersoy) #2

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

(Ole Ersoy) #3

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

(Florian Castelain) #4

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

Can't update package-lock.json
(Ole Ersoy) #5

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

(Ole Ersoy) #6

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

(Ole Ersoy) #7

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

(Ole Ersoy) #8

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

(John Gee) #9

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
(Florian Castelain) #10

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

(John Gee) #11

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

(Florian Castelain) #12

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

1 Like
(John Gee) #13

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

(Florian Castelain) #14

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

(John Gee) #15

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

(Keila Hoover) #16

This worked! Thank you so much!