npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

Please help...can't update cordova with npm

when i try to update cordova

sudo npm i -g cordova

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

but the error remains


Unhandled rejection Error: EISDIR: illegal operation on a directory, open ‘/Users/user/.npm/_cacache/index-v5/13/29’

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/user/.npm/_logs/2019-03-31T06_40_17_263Z-debug.log



sudo cordova platform add android

Using cordova-fetch for cordova-android@~7.1.1

Failed to fetch platform cordova-android@~7.1.1

Probably this is either a connection problem, or platform spec is incorrect.

Check your connection and platform name/version/URL.

Error: npm: Command failed with exit code 1 Error output:

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

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/user/.npm/_logs/2019-03-31T06_52_44_073Z-debug.log


I am stumped. A couple of questions, what do these show:

npm prefix -g
echo $SHELL

(It is good practice to avoid using sudo with npm, but that does take extra setup. I’m exploring other quick fixes before going down that route.)