Unhandled rejection Error: EISDIR: illegal operation on a directory, open '/Users/<username>/.npm/_cacache/content-v2/sha512/4c/13'

(David Long) #1

My npm version is 6.4.1

When I tried to do npm install, I got an error:

Porch-MB-051:~ <username>$ sudo npm install -g gulp

Unhandled rejection Error: EISDIR: illegal operation on a directory, open '/Users/<username>/.npm/_cacache/content-v2/sha512/4c/13'

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:

npm ERR! &lt;https://npm.community&gt;

npm ERR! A complete log of this run can be found in:

npm ERR! /Users/<username>/.npm/_logs/2019-03-16T23_50_34_838Z-debug.log

Then I tried to open the log file 2019-03-16T23_50_34_838Z-debug.log:

0 info it worked if it ends with ok
1 verbose cli [ '/Users/<username>/.nvm/versions/node/v8.10.0/bin/node',
1 verbose cli   '/Users/<username>/.nvm/versions/node/v8.10.0/bin/npm',
1 verbose cli   'install',
1 verbose cli   '-g',
1 verbose cli   'gulp' ]
2 info using npm@6.9.0
3 info using node@v8.10.0
4 verbose npm-session 192b50b310539518
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 timing npm Completed in 1126ms
8 error cb() never called!
9 error This is an error with npm itself. Please report this error at:
10 error <https://npm.community>

I uninstall npm and reinstall npm, but I still see the error. Can someone please help me? Thanks!

0 Likes

(John Gee) #2

Hi! 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.

0 Likes

(David Long) #3

Thanks @shadowspawn for the reply. I tried your suggestion:

sudo chown -R $(whoami) ~/.npm

But I still have the same error:

Unhandled rejection Error: EISDIR: illegal operation on a directory, open ‘/Users/davidlong/.npm/_cacache/content-v2/sha512/e6/e5’

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//.npm/_logs/2019-03-17T00_47_01_939Z-debug.log

Is there anything else I can try? Thanks.

0 Likes

(David Long) #4

@shadowspawn, actually I needed to add the -f option to force the command to change the owner to myself, or else it wouldn’t change from the root owner.

So this works for me:

sudo chown -f -R $(whoami) ~/.npm

Thanks again!

1 Like

(Bike2live) #5

Edited.

Got this for the first time this morning. Using npm 6.9.0. Attempted to upgrade npm-check-updates globally: sudo npm i -g npm-check-updates.

I’ve cleared the npm cache (npm cache clear --force),
and changed the ownership of ~/.npm (sudo chown -R $(whoami) ~/.npm)

I still get:
Unhandled rejection Error: EISDIR: illegal operation on a directory, open '/Users/user/.npm/_cacache/content-v2/sha512/b8/23’newer version or is no longer required

Unhandled rejection Error: EISDIR: illegal operation on a directory, open '/Users/user/.npm/_cacache/content-v2/sha512/ad/d0’newer version or is no longer required

Unhandled rejection Error: EISDIR: illegal operation on a directory, open ‘/Users/user/.npm/_cacache/content-v2/sha512/ce/56’

Unhandled rejection Error: EISDIR: illegal operation on a directory, open ‘/Users/user/.npm/_cacache/content-v2/sha512/59/ac’

Unhandled rejection Error: EISDIR: illegal operation on a directory, open ‘/Users/user/.npm/_cacache/content-v2/sha512/37/9f’

Unhandled rejection Error: EISDIR: illegal operation on a directory, open ‘/Users/user/.npm/_cacache/content-v2/sha512/49/86’

Unhandled rejection Error: EISDIR: illegal operation on a directory, open ‘/Users/user/.npm/_cacache/content-v2/sha512/d8/5a’

Unhandled rejection Error: EISDIR: illegal operation on a directory, open ‘/Users/user/.npm/_cacache/content-v2/sha512/a6/17’

Unhandled rejection Error: EISDIR: illegal operation on a directory, open ‘/Users/user/.npm/_cacache/content-v2/sha512/bd/45’

Unhandled rejection Error: EISDIR: illegal operation on a directory, open '/Users/user/.npm/_cacache/content-v2/sha512/81/da’newer version or is no longer required

Log file:

0 info it worked if it ends with ok
1 verbose cli [ ‘/usr/local/bin/node’,
1 verbose cli ‘/usr/local/bin/npm’,
1 verbose cli ‘i’,
1 verbose cli ‘-g’,
1 verbose cli ‘npm-check-updates’ ]
2 info using npm@6.9.0
3 info using node@v8.14.1
4 verbose npm-session 5919d6e958161657
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 200 https://registry.npmjs.org/npm-check-updates 299ms
8 silly pacote tag manifest for npm-check-updates@latest fetched in 320ms
9 timing stage:loadCurrentTree Completed in 802ms
10 silly install loadIdealTree
11 silly install cloneCurrentTreeToIdealTree
12 timing stage:loadIdealTree:cloneCurrentTree Completed in 3ms
13 silly install loadShrinkwrap
14 timing stage:loadIdealTree:loadShrinkwrap Completed in 53ms
15 silly install loadAllDepsIntoIdealTree
16 silly resolveWithNewModule npm-check-updates@3.1.0 checking installable status
17 silly removeObsoleteDep removing npm-check-updates@3.0.8 from the tree as its been replaced by a newer version or is no longer required
18 silly removeObsoleteDep removing bluebird@3.5.3 from the tree as its been replaced by a newer version or is no longer required
19 silly removeObsoleteDep removing cint@8.2.1 from the tree as its been replaced by a newer version or is no longer required
20 silly removeObsoleteDep removing cli-table@0.3.1 from the tree as its been replaced by a newer version or is no longer required
21 silly removeObsoleteDep removing colors@1.0.3 from the tree as its been replaced by a newer version or is no longer required
22 silly removeObsoleteDep removing commander@2.19.0 from the tree as its been replaced by a newer version or is no longer required
23 silly removeObsoleteDep removing fast-diff@1.2.0 from the tree as its been replaced by a newer version or is no longer required
24 silly removeObsoleteDep removing find-up@3.0.0 from the tree as its been replaced by a newer version or is no longer required
25 silly removeObsoleteDep removing locate-path@3.0.0 from the tree as its been replaced by a newer version or is no longer required
26 silly removeObsoleteDep removing p-locate@3.0.0 from the tree as its been replaced by a newer version or is no longer required
27 silly removeObsoleteDep removing p-limit@2.2.0 from the tree as its been replaced by a newer version or is no longer required
28 silly removeObsoleteDep removing p-try@2.0.0 from the tree as its been replaced by a newer version or is no longer required
29 silly removeObsoleteDep removing get-stdin@6.0.0 from the tree as its been replaced by a newer version or is no longer required
30 silly removeObsoleteDep removing json-parse-helpfulerror@1.0.3 from the tree as its been replaced by a newer version or is no longer required
31 silly removeObsoleteDep removing jju@1.4.0 from the tree as its been replaced by a newer version or is no longer required
32 silly removeObsoleteDep removing node-alias@1.0.4 from the tree as its been replaced by a newer version or is no longer required
33 silly removeObsoleteDep removing chalk@1.1.3 from the tree as its been replaced by a newer version or is no longer required
34 silly removeObsoleteDep removing ansi-styles@2.2.1 from the tree as its been replaced by a newer version or is no longer required
35 silly removeObsoleteDep removing has-ansi@2.0.0 from the tree as its been replaced by a newer version or is no longer required
36 silly removeObsoleteDep removing ansi-regex@2.1.1 from the tree as its been replaced by a newer version or is no longer required
37 silly removeObsoleteDep removing strip-ansi@3.0.1 from the tree as its been replaced by a newer version or is no longer required
38 silly removeObsoleteDep removing supports-color@2.0.0 from the tree as its been replaced by a newer version or is no longer required
39 silly removeObsoleteDep removing lodash@4.17.11 from the tree as its been replaced by a newer version or is no longer required

0 Likes

(John Gee) #6

@bike2live

Are you really getting error messages without a username in path? (Or did you delete username before posting?)

/Users//.npm/...
0 Likes

(Bike2live) #7

I redacted the user folder for security purposes. It is there.

0 Likes

(system) closed #8

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

0 Likes