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

npm updates broken in latest (8.6.0), alpine (8.6.0-alpine), boron #541

Closed
actualben opened this issue Oct 8, 2017 · 3 comments
Closed
Labels

Comments

@actualben
Copy link

actualben commented Oct 8, 2017

Description

Running npm update -g inside node:latest completes but causes npm to break on all subsequent calls.

Similar errors appear in node:alpine and node:boron.

The test command does work with node:argon

Steps to Reproduce

  1. Run this command: docker pull node:latest && docker run --rm node:latest sh -c "npm update -g && npm -v"

Expected result

I expected to see the new npm version number printed

Observed result

I get the error: Cannot find module 'npmlog'.

If I run npm install -g npmlog before the update command, the error becomes Cannot find module 'update-notifier'. If I install that, the error becomes Cannot find module 'graceful-fs' and so on, I didn't find the end, even after pre-installing config-chain, inherits, and nopt.

Example transcript

% docker pull node:latest && docker run --rm node:latest sh -c "npm update -g && npm -v"       
latest: Pulling from library/node
Digest: sha256:a8918e06476bef51ab83991aea7c199bb50bfb131668c9739e6aa7984da1c1f6
Status: Image is up to date for node:latest
npm info it worked if it ends with ok
npm info using npm@5.3.0
npm info using node@v8.6.0
npm info attempt registry request try #1 at 02:29:48
[...]
chunk deleted for bug report
[...]
npm info lifecycle npm@5.5.1~postinstall: npm@5.5.1
+ npm@5.5.1
added 73 packages, removed 24 packages and updated 44 packages in 23.12s
npm info ok 
module.js:529
    throw err;
    ^

Error: Cannot find module 'npmlog'
    at Function.Module._resolveFilename (module.js:527:15)
    at Function.Module._load (module.js:476:23)
    at Module.require (module.js:568:17)
    at require (internal/module.js:11:18)
    at /usr/local/lib/node_modules/npm/bin/npm-cli.js:22:13
    at Object.<anonymous> (/usr/local/lib/node_modules/npm/bin/npm-cli.js:92:3)
    at Module._compile (module.js:624:30)
    at Object.Module._extensions..js (module.js:635:10)
    at Module.load (module.js:545:32)
    at tryModuleLoad (module.js:508:12)
@actualben actualben changed the title npm updates broken in latest npm updates broken in latest (8.6.0) and alpine (8.6.0-alpine) Oct 8, 2017
@actualben actualben changed the title npm updates broken in latest (8.6.0) and alpine (8.6.0-alpine) npm updates broken in latest (8.6.0), alpine (8.6.0-alpine), boron Oct 8, 2017
@LaurentGoderre
Copy link
Member

The issue might be with the -g. See https://github.com/nodejs/docker-node/pull/540/files

@SimenB
Copy link
Member

SimenB commented Oct 8, 2017

npm@5 is unable to update itself in a docker container. Doing yarn global add npm usually works.

#520 (comment)
#449 (comment)
#450 (comment)

@SimenB SimenB added the npm label Oct 8, 2017
@SimenB
Copy link
Member

SimenB commented Oct 24, 2017

Closing as this is not actionable on our side, and a workaround has been posted

@SimenB SimenB closed this as completed Oct 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants