Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] EPERM during npm install (breakage between npm 6.9 and 6.13) #578

Closed
jgehrcke opened this issue Dec 10, 2019 · 4 comments
Closed

[BUG] EPERM during npm install (breakage between npm 6.9 and 6.13) #578

jgehrcke opened this issue Dec 10, 2019 · 4 comments

Comments

@jgehrcke
Copy link
Contributor

  • This is with NodeJS v12.13.1.
  • I am running an npm install . in a Docker container in CI.
  • With NPM 6.13.2 it fails with EPERM during child process creation (stdout/err below).
  • With NPM 6.9.2 it suceeds.
  • I did not carefully bisect, i.e. I did not try npm 6.10.x or 6.11.x.
  • There are no obvious permission issues: the unix user executing the npm install . in the container has as of my (I think rather experienced) judgement all required privileges that it needs to do things; the EPERM during child process creation came completely out-of-the-blue for me.
  • The fact that the install "just works" with NPM 6.9.2 leads me to suspect that there potentially is a bug in more recent versions of NPM.

Fortunately, I have a reproducible CI environment at hand. While I cannot provide a complete repro for you to execute locally, I at least can tell for sure that switching the NPM version reproducibly did the trick for me (no other parameters changed).

The problem might be rare, but I found the same symptoms described in these two threads from the recent weeks:

Notably, I think this post contains highly relevant detail for root-causing and mitigating this: https://npm.community/t/npm-6-11-x-breaks-npm-ci-with-eperm-error-for-private-github-package/9872/3

With npm/6.13.2

$ npm install .

[...]

npm ERR! code EPERM
--
  | npm ERR! syscall spawn
  | npm ERR! errno EPERM
  | npm ERR! Error: spawn EPERM
  | npm ERR!     at ChildProcess.spawn (internal/child_process.js:394:11)
  | npm ERR!     at Object.spawn (child_process.js:540:9)
  | npm ERR!     at /nvm/versions/node/v12.13.1/lib/node_modules/npm/node_modules/pacote/lib/util/git.js:216:24
  | npm ERR!     at /nvm/versions/node/v12.13.1/lib/node_modules/npm/node_modules/promise-retry/index.js:29:24
  | npm ERR!     at runMicrotasks (<anonymous>)
  | npm ERR!     at processTicksAndRejections (internal/process/task_queues.js:93:5)
  | npm ERR!  OperationalError: spawn EPERM
  | npm ERR!     at ChildProcess.spawn (internal/child_process.js:394:11)
  | npm ERR!     at Object.spawn (child_process.js:540:9)
  | npm ERR!     at /nvm/versions/node/v12.13.1/lib/node_modules/npm/node_modules/pacote/lib/util/git.js:216:24
  | npm ERR!     at /nvm/versions/node/v12.13.1/lib/node_modules/npm/node_modules/promise-retry/index.js:29:24
  | npm ERR!     at runMicrotasks (<anonymous>)
  | npm ERR!     at processTicksAndRejections (internal/process/task_queues.js:93:5) {
  | npm ERR!   cause: Error: spawn EPERM
  | npm ERR!       at ChildProcess.spawn (internal/child_process.js:394:11)
  | npm ERR!       at Object.spawn (child_process.js:540:9)
  | npm ERR!       at /nvm/versions/node/v12.13.1/lib/node_modules/npm/node_modules/pacote/lib/util/git.js:216:24
  | npm ERR!       at /nvm/versions/node/v12.13.1/lib/node_modules/npm/node_modules/promise-retry/index.js:29:24
  | npm ERR!       at runMicrotasks (<anonymous>)
  | npm ERR!       at processTicksAndRejections (internal/process/task_queues.js:93:5) {
  | npm ERR!     errno: 'EPERM',
  | npm ERR!     code: 'EPERM',
  | npm ERR!     syscall: 'spawn'
  | npm ERR!   },
  | npm ERR!   stack: 'Error: spawn EPERM\n' +
  | npm ERR!     '    at ChildProcess.spawn (internal/child_process.js:394:11)\n' +
  | npm ERR!     '    at Object.spawn (child_process.js:540:9)\n' +
  | npm ERR!     '    at /nvm/versions/node/v12.13.1/lib/node_modules/npm/node_modules/pacote/lib/util/git.js:216:24\n' +
  | npm ERR!     '    at /nvm/versions/node/v12.13.1/lib/node_modules/npm/node_modules/promise-retry/index.js:29:24\n' +
  | npm ERR!     '    at runMicrotasks (<anonymous>)\n' +
  | npm ERR!     '    at processTicksAndRejections (internal/process/task_queues.js:93:5)',
  | npm ERR!   errno: 'EPERM',
  | npm ERR!   code: 'EPERM',
  | npm ERR!   syscall: 'spawn',
  | npm ERR!   parent: 'build'
  | npm ERR! }
  | npm ERR!
  | npm ERR! The operation was rejected by your operating system.
  | npm ERR! It is likely you do not have the permissions to access this file as the current user
  | npm ERR!
  | npm ERR! If you believe this might be a permissions issue, please double-check the
  | npm ERR! permissions of the file and its containing directories, or try running
  | npm ERR! the command again as root/Administrator.

(build log 308, 191204, for my own reference)

With npm/6.9.2

  • And otherwise the exact same build environment as above, just with npm 6.9.2 instead of npm 6.13.2.

Installation succeeds:

npm install .

[...]

added 1045 packages from 700 contributors and audited 879804 packages in 318.65s

(build log 309, 191204, for my own reference)

Sorry that at this time I am not in the position to provide a complete repro.

@jgehrcke
Copy link
Contributor Author

Oh, now I found #476. I suppose that is it, and I can try with npm 6.13.3 :-).

@jgehrcke
Copy link
Contributor Author

I will report back after trying out npm 6.13.3.

@isaacs
Copy link
Contributor

isaacs commented Dec 10, 2019

I am confident this is fixed in 6.13.3. Closing now so we don't forget, but happy to reopen if it turns out it didn't fix this problem.

@isaacs isaacs closed this as completed Dec 10, 2019
@jgehrcke
Copy link
Contributor Author

I will report back after trying out npm 6.13.3.

Indeed fixed things :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants