npm Community Forum (Archive)

The npm community forum has been discontinued.

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

npm install @amplify/cli bug

What I Wanted to Do

npm install -g @aws-amplify/cli to install the amplify cli tool

What Happened Instead

Unhandled rejection Error: EISDIR: illegal operation on a directory, open ‘/Users/arthur/.npm/_cacache/content-v2/sha512/a4/f1’

cb() never called!

This is an error with npm itself. Please report this error at: https://npm.community

Reproduction Steps

See what I tried to do…

Details

Used npm@6.9.0 and node@v8.1.1

Platform Info

macOS Mojave, Version 10.14.4. beta (18E220a)

$ npm --versions
{ redirectservice: '0.0.0',
  npm: '6.9.0',
  ares: '1.10.1-DEV',
  cldr: '32.0',
  http_parser: '2.8.0',
  icu: '60.1',
  modules: '57',
  nghttp2: '1.25.0',
  node: '8.11.1',
  openssl: '1.0.2o',
  tz: '2017c',
  unicode: '10.0',
  uv: '1.19.1',
  v8: '6.2.414.50',
  zlib: '1.2.11' }
$ node -p process.platform
darwin


Hi Arthur! Thanks for report. 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.