Problem installing depcheck with NPM@6.7.0


(Robert Lamoureux) #1

What I Wanted to Do

I was trying to install the dependency check package. (npm install -g depcheck)

What Happened Instead

Unhandled rejection Error: EISDIR: illegal operation on a directory, open ‘/Users/XXXXXXXX/.npm/_cacache/content-v2/sha512/d9/60’
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:

Reproduction Steps

npm install -g depcheck

Details

Log file :
0 info it worked if it ends with ok
1 verbose cli [ ‘/usr/local/Cellar/node@8/8.11.2/bin/node’,
1 verbose cli ‘/usr/local/bin/npm’,
1 verbose cli ‘install’,
1 verbose cli ‘-g’,
1 verbose cli ‘depcheck’ ]
2 info using npm@6.7.0
3 info using node@v8.11.2
4 verbose npm-session 7e6da6c31f5138ba
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 timing npm Completed in 1522ms
8 error cb() never called!
9 error This is an error with npm itself. Please report this error at:
10 error <https://npm.community>

Platform Info

$ npm --versions
{ 'pwa-starter-kit': '0.9.0',
  npm: '6.7.0',
  ares: '1.10.1-DEV',
  cldr: '33.0',
  http_parser: '2.8.0',
  icu: '61.1',
  modules: '57',
  napi: '3',
  nghttp2: '1.29.0',
  node: '8.11.2',
  openssl: '1.0.2o',
  tz: '2018c',
  unicode: '10.0',
  uv: '1.19.1',
  v8: '6.2.414.54',
  zlib: '1.2.11' }

$ node -p process.platform
darwin

Solution to the EISDIR connundrum
(Kat Marchán) #2

Does this still happen if you npm i -g depcheck --cache /tmp/npm-cache?


(Siroj Inadïas) #3

Same problem since I upgraded to 6.7.0. Rolling back to 6.6.0 solved it.
sudo npm i -g npm@6.6.0


(John Gee) #4

I reproduced a possible related change in behaviour. Changing ownership of files seems to fix the problem, so I looked at what is happening in the cache and can see a difference with npm@6.4.1 vs npm@latest. I have not reproduced steps to get a subsequent EISDIR error yet, so not full story.

$ node -p process.platform
darwin

$ sudo npm install --global npm@6.4.1
$ sudo rm -rf ~/.npm
$ sudo npm install --global npm@latest
$ find ~/.npm -user root -ls
8628721649        8 -rw-r--r--    1 root             staff                 171  6 Feb 11:41 /Users/john/.npm/anonymous-cli-metrics.json

$ sudo npm install --global npm@latest
$ sudo rm -rf ~/.npm
$ sudo npm install --global npm@latest
$ find ~/.npm -user root -ls
8628691641        8 -rw-r--r--    1 root             staff                 171  6 Feb 11:38 /Users/john/.npm/anonymous-cli-metrics.json
8628681297        0 drwxr-xr-x    3 root             staff                  96  6 Feb 11:38 /Users/john/.npm/_cacache/content-v2/sha512/0b
8628681298        0 drwxr-xr-x    3 root             staff                  96  6 Feb 11:38 /Users/john/.npm/_cacache/content-v2/sha512/0b/61
8628681296        8 -r--r--r--    1 root             staff                   1  6 Feb 11:38 /Users/john/.npm/_cacache/content-v2/sha512/0b/61/241d7c17bcbb1baee7094d14b7c451efecc7ffcbd92598a0f13d313cc9ebc2a07e61f007baf58fbf94ff9a8695bdd5cae7ce03bbf1e94e93613a00f25f21
8628681301        0 drwxr-xr-x    3 root             staff                  96  6 Feb 11:38 /Users/john/.npm/_cacache/index-v5/30
8628681302        0 drwxr-xr-x    3 root             staff                  96  6 Feb 11:38 /Users/john/.npm/_cacache/index-v5/30/c0
8628681303       16 -rw-r--r--    1 root             staff                5681  6 Feb 11:38 /Users/john/.npm/_cacache/index-v5/30/c0/25a0601b780c56128977fafb7e247761d02a59b8f5a6cb260b629fc15d6c