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 5.3.0 in node 8 #450

Closed
kachkaev opened this issue Jul 6, 2017 · 13 comments
Closed

npm 5.3.0 in node 8 #450

kachkaev opened this issue Jul 6, 2017 · 13 comments
Labels

Comments

@kachkaev
Copy link

kachkaev commented Jul 6, 2017

Just opening this to discuss npm 5 upgrade due to its recent important release. It fixes quite a few serious bugs in npm install, which used to break the contents node_modules directory between the commits.

I guess I'm not the only person interested to know when to finally uncomment node_modules caching in CI and thus get some speed boost and reduce the load on the public registry :–)

@SimenB
Copy link
Member

SimenB commented Jul 6, 2017

Official policy is to not update it, as it's bundled with node itself. So normally we'd wait until the next node update. Not sure if we want to make an exception or not for this one?
(npm cannot self-update itself, #449, so it's a bit convoluted to update it)

https://github.com/nodejs/docker-node/blob/8cbad29a9f652f974a59daf7dd4743b92c322c3b/CONTRIBUTING.md#version-updates

@kachkaev
Copy link
Author

kachkaev commented Jul 6, 2017

Yeah, it might deserve some kind of an exception because of the number of problems in npm 5.0.x. Does node have to get a minor version bump to cause npm's minor version bump? Or can node 8.1.3 → 8.14 upgrade imply npm 5.0.3 → 5.1.0? UPD 5.3.0

@cnadeau
Copy link

cnadeau commented Jul 6, 2017

I really think it would be a great idea because trying:

FROM node:8.1.3-alpine
RUN npm install -g npm@5.1.0
CMD npm --version

Building the image

Sending build context to Docker daemon  3.072kB
Step 1/3 : FROM node:8.1.3-alpine
 ---> 52102cf589d3
Step 2/3 : RUN npm install -g npm@5.1.0
 ---> Running in a8c48c3ec1c5
<omitted npm install logs>
+ npm@5.1.0
added 27 packages, removed 16 packages and updated 47 packages in 12.299s
npm info ok
 ---> ce5a3bfcb473
Removing intermediate container a8c48c3ec1c5
Step 3/3 : CMD npm --version
 ---> Running in d3fffdc1a709
 ---> 9f08ed524fa2
Removing intermediate container d3fffdc1a709
Successfully built 9f08ed524fa2

Running the container using this image

module.js:487
    throw err;
    ^

Error: Cannot find module 'semver'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/unsupported.js:2:14)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)

@SimenB
Copy link
Member

SimenB commented Jul 6, 2017

Yes, as mentioned, this is known. #449

@SimenB
Copy link
Member

SimenB commented Jul 7, 2017

You can do this as a workaround:

FROM node:8

RUN yarn global add npm

RUN npm --version

It works with alpine as well.

@chorrell
Copy link
Contributor

Are we good to close this out? It's an npm issue that I'm assuming will get fixed in a future v8.1 update.

@kachkaev
Copy link
Author

kachkaev commented Jul 12, 2017

Hi @chorrell, do you mean 8.1.5? Just tried 8.1.4 – npm is still 5.0.3

docker run -it node:8.1.4 /bin/sh
node --version
# v8.1.4
npm --version
# 5.0.3

Might be worth keeping this issue open until 5.1.0+ is out there – some people might be subscribed to updates and are waiting for a moment when they can update their CI scripts :–) node_modules can't be cached between the build in npm 5.0.* because of a bug.

@chorrell
Copy link
Contributor

No, I wasn't thinking of a specific v8.x.x release.

I did a quick search and I think this would be a better issue to track:

nodejs/node#14163

Looks like npm v5.2.0 is due to land (I think) in v8.2.0:

nodejs/node#13744

@SimenB
Copy link
Member

SimenB commented Jul 13, 2017

+1 on closing. Our policy is to to not track npm releases, just use what's bundled in node.

If someone really wants to upgrade npm, they can just do npm i -g npm (in general, right now that's broken).

@kachkaev kachkaev changed the title npm 5.1.0 in node 8 npm 5.3.0 in node 8 Jul 14, 2017
@SimenB
Copy link
Member

SimenB commented Jul 15, 2017

nodejs/node#14235

@necramirez
Copy link

Node 8.2.0 is out, with npm 5.3.0 bundled! Hopefully, it would be published to Docker Hub soon.

@SimenB
Copy link
Member

SimenB commented Jul 20, 2017

A PR to docker hub is up: docker-library/official-images#3210

After that's merged it'll generally appear in 1-2 hours

@SimenB
Copy link
Member

SimenB commented Jul 21, 2017

It's out now.

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

5 participants