@justingrant wrote:
What I Wanted to Do
Install a global package using
sudo npm -g
on my Mac running NPM 6.5What Happened Instead
Every global install failed. Errors included many like this:
WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/npm-3e479054/node_modules/widest-line'
And finally one like this that stopped the install:
npm WARN enoent ENOENT: no such file or directory, open '/private/tmp/npm-31930-3d7b0f16/unpack-dda66812/node_modules/run-queue/package.json' npm ERR! path /private/tmp/npm-31930-3d7b0f16/unpack-dda66812/node_modules/run-queue/package.json npm ERR! code ENOENT npm ERR! errno -2 npm ERR! syscall open npm ERR! enoent ENOENT: no such file or directory, open '/private/tmp/npm-31930-3d7b0f16/unpack-dda66812/node_modules/run-queue/package.json' npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent
Reproduction Steps
- Install node via downloadable Mac (Mojave 10.14.2) installer: https://nodejs.org/dist/v10.14.2/node-v10.14.2.pkg
sudo npm install -g npm@6.4.1
to downgrade to working NPMsudo npm i -g serverless
- Works fine.
sudo npm install -g npm@latest
sudo npm i -g serverless
- FAIL!
Details
Here’s the NPM debug log shown on 6.5 when trying to re-install the
serverless
package (after it was successfully installed after the 6.4.1 downgrade, per the repro above).
2018-12-14T19_09_42_771Z-debug.log (292.4 KB)I’m a new user on this forum so can’t post multiple log files, but before I successfully upgraded the
serverless
package (via downgrade to 6.4.1) I tried to install it earlier and it still failed, but in addition to the eventual error I also got a bunch of warnings like this:
WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/npm-3e479054/node_modules/widest-line'
Let me know if you need the logfile including these warnings and I can email it to you (or can attach here if I can get permission to do it).
BTW, here’s a support thread reporting the same problem: EISDIR: illegal operation on a directory, open
Platform Info
$ npm --versions { npm: '6.5.0', ares: '1.15.0', cldr: '33.1', http_parser: '2.8.0', icu: '62.1', modules: '64', napi: '3', nghttp2: '1.34.0', node: '10.14.2', openssl: '1.1.0j', tz: '2018e', unicode: '11.0', uv: '1.23.2', v8: '6.8.275.32-node.45', zlib: '1.2.11' } $ node -p process.platform darwin
Posts: 30
Participants: 17