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

update npm to 5.8.0 #19840

Closed
wants to merge 3 commits into from
Closed

update npm to 5.8.0 #19840

wants to merge 3 commits into from

Conversation

MylesBorins
Copy link
Contributor

Another attempt after #19560 broke master. Because npm removed node-gyp we now need to vendor it. I've added it to tools/node_modules similar to our other vendored dependencies. I've also gone ahead and make a script to update the dep, update the license builder, update the license, and update the Makefile.

I'm going to run CITGM on this... I'm curious if this will have any effect on native modules at all.

/cc @iarna why did y'all remove node-gyp, and are there any edge cases we should expect?

@MylesBorins MylesBorins requested review from addaleax and iarna April 5, 2018 22:35
@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to build files or the CI. meta Issues and PRs related to the general management of the project. npm Issues and PRs related to the npm client dependency or the npm registry. labels Apr 5, 2018
@MylesBorins
Copy link
Contributor Author

Also, it would be possible to move the node-gyp folder out of the npm directory before updating npm. This may make the diff a bit smaller when updating gyp via the script... although I'm not sure if this really makes a difference for git internals... just wanted to make an offer to do so

FallenRiteMonk and others added 2 commits April 5, 2018 18:38
Currently npm explicitly doesn't support 10.x and will fail on master.
This patch manually adds support for 10.x so that we can keep an up to
date version of npm on master.

refs: nodejs#17535
PR-URL: nodejs#17777
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
@MylesBorins
Copy link
Contributor Author

@MylesBorins
Copy link
Contributor Author

/cc @nodejs/build and @nodejs/tsc as this change has gotten a bit bigger in scope

@jasnell
Copy link
Member

jasnell commented Apr 5, 2018

Wait... 5.8 removed node-gyp in a minor release? Ugh.

@addaleax
Copy link
Member

addaleax commented Apr 5, 2018

@jasnell No, the files just moved around in-tree

@jasnell
Copy link
Member

jasnell commented Apr 5, 2018

No, the files just moved around in-tree

Phew... ok good.... :-) gave me a slight mini heart attack there.

@rvagg
Copy link
Member

rvagg commented Apr 5, 2018

so wait, was it removed or moved? did @MylesBorins add it to node_modules or .. what is going on? is there a reference for what this is all about?

@addaleax
Copy link
Member

addaleax commented Apr 5, 2018

$ grep version tools/node_modules/node-gyp/package.json 
  "version": "3.6.2"
$ grep version deps/npm/node_modules/npm-lifecycle/node_modules/node-gyp/package.json 
  "version": "3.6.2"

This PR is adding a second copy.

I think we could just hoist node-gyp back to its old location in the npm tree manually

@MylesBorins
Copy link
Contributor Author

MylesBorins commented Apr 6, 2018 via email

node-gyp has been moved in the tree of npm. This update fixes
references to the location in the Makefile
@MylesBorins
Copy link
Contributor Author

rolled back the node-gyp stuff and simply updated the Makefile to reference the new location in the npm node_modules tree.

CI: https://ci.nodejs.org/job/node-test-pull-request/14084/
CI for master: https://ci.nodejs.org/job/node-test-commit/17479/ (there were weird failures in last CI)

Copy link
Member

@richardlau richardlau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vcbuild.bat will also need to be updated with the new node-gyp location.

@richardlau
Copy link
Member

The AIX failure is real. node-gyp's lib/find-node-directory.js assumes it lives in npm/node_modules/node-gyp/lib.

Cc @nodejs/platform-aix

@rvagg
Copy link
Member

rvagg commented Apr 6, 2018

The AIX failure is real. node-gyp's lib/find-node-directory.js assumes it lives in npm/node_modules/node-gyp/lib.

I've seen a lot of code (and maybe I've written some ...) that makes this assumption, moving it could cause some yelping. +1 to hoisting it although we should probably have this discussion with npm folks.

@ChALkeR
Copy link
Member

ChALkeR commented Apr 6, 2018

I just observed Atom text editor failing to install or update any plugins because of this with system-wide npm@5.8.0 install.

https://github.com/npm/npm/blob/master/bin/node-gyp-bin/node-gyp — npm itself fails on 5.8.0 when executing this file.

Related: npm/npm#20163, mapbox/node-pre-gyp#362

@zkat
Copy link
Contributor

zkat commented Apr 6, 2018

As pointed out: we didn't remove node-gyp, but instead moved it so it lives under npm-lifecycle now, as part of refactoring these bits into separate pieces.

@MylesBorins
Copy link
Contributor Author

@zkat I think the issue is that node-gyp itself has code internally expecting to live at that location... And there is a non trivial amount of code in the ecosystem making similar assumption

@zkat
Copy link
Contributor

zkat commented Apr 6, 2018

@MylesBorins npm/npm#20276

If this works, it should be pretty easy to backport as well.

@MylesBorins
Copy link
Contributor Author

@zkat 🎉

@ChALkeR
Copy link
Member

ChALkeR commented Apr 6, 2018

Yes, npm/npm#20276 looks like an ideal solution (especially the tests part). Thanks, @zkat!

@BridgeAR
Copy link
Member

Should this stay open due to #20190?

@MylesBorins
Copy link
Contributor Author

MylesBorins commented Apr 22, 2018 via email

@p0psicles
Copy link

@MylesBorins does this mean there is a chance that npm 5.8.x get's released (packaged) with a node 8.x.x version?

@BridgeAR
Copy link
Member

Ping @MylesBorins about retargeting this PR

@MylesBorins
Copy link
Contributor Author

@BridgeAR I'm going to go ahead and close this for now. We would need a different 5.x version to fix the node-gyp issue. If 6.x lands on master in a timely fashion we can backport in an 8.x minor, which is coming in the next month

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. meta Issues and PRs related to the general management of the project. npm Issues and PRs related to the npm client dependency or the npm registry.
Projects
None yet
Development

Successfully merging this pull request may close these issues.