You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This looks like test-npm/bin/npm is incorrectly resolving npm-cli.js -- I think test-npm/bin/npm is written for an installed Node (i.e. expecting npm to live under a node_modules directory) and not the copy made for the test.
From my perspective requiring a global install is not that friendly. I'd want people to be able to easily run the tests without having to affect their environment outside of the tree they are compiling Node in. And there was some prior agreement on that so we should discuss.
@Fishrock123 As of npm/npm#11204, npm will spawn its script child processes with the Node.js version it was invoked with by adding the directory in which process.execPath resides to the PATH.
According to the PR’s milestones, that’s npm >= 3.7.0 and >= 2.14.17, which have been bundled with Node.js >= 5.8.0 and >= 4.4.0 respectively… I’ve done a ton of digging on issues that were related to that change.
Activity
richardlau commentedon Apr 15, 2016
CC @zkat
MylesBorins commentedon Apr 15, 2016
@richardlau this is my bad. It looks like it is the result of the recent upgrade to npm v2.15.1
This is now fixed in
v4.x-stagingThank you for pointing this out!
MylesBorins commentedon Apr 15, 2016
it is worth mentioning that
make test-npmis now working as expected onv4.x-stagingrichardlau commentedon Apr 15, 2016
@thealphanerd Nope, still fails for me with
v4.x-stagingrichardlau commentedon Apr 15, 2016
MylesBorins commentedon Apr 15, 2016
richardlau commentedon Apr 15, 2016
Is this documented anywhere?
richardlau commentedon Apr 15, 2016
(No I wasn't running make install first, there wasn't anything suggesting I needed to do that)
mhdawson commentedon Apr 15, 2016
There was earlier issues with this:
#1926
and I believe we were trying to ensure it could continue to run without having to install node globally
MylesBorins commentedon Apr 15, 2016
I've sent a PR to update the docs
#6231
mhdawson commentedon Apr 15, 2016
Reopening for discussion as to whether it should required a global install
mhdawson commentedon Apr 15, 2016
From my perspective requiring a global install is not that friendly. I'd want people to be able to easily run the tests without having to affect their environment outside of the tree they are compiling Node in. And there was some prior agreement on that so we should discuss.
Fishrock123 commentedon Apr 15, 2016
There's not much to discuss here. That is the state of things in npm 2 and fixing it isn't super trivial iirc.
Besides, most people aren't going to be running those tests, and we're adding a doc note about it.
Fishrock123 commentedon Apr 15, 2016
Note that this works as expected on master with npm 3.
MylesBorins commentedon Apr 15, 2016
@mhdawson #1926 was never backported to v4.x
So here is package.json for npm in v4.4.1 which we are aware of working in CI
node/deps/npm/package.json
Line 193 in 5368455
as you can see it calls to npm expecting it in the path. Nothing has changed here between v4.4.1 and v4.4.3
Alternatively on master we can see that npm 3 is a bit smarter about setting up the env
https://github.com/nodejs/node/blob/master/deps/npm/package.json#L210
mhdawson commentedon Apr 15, 2016
Ok so I can understand "its already fixed in later versions" and was always broken in post 0.12.X so we won't fix the versions in the middle.
In that case I expect Richard's problem is unrelated to have to do the global install as the tests were running ok until 4.4.2
Fishrock123 commentedon Apr 24, 2016
Iirc even with our tools fix, npm will create child processes on a global node.
(Note: I may be incorrect on that, and anyone is welcome to investigate!)
addaleax commentedon Apr 24, 2016
@Fishrock123 As of npm/npm#11204, npm will spawn its script child processes with the Node.js version it was invoked with by adding the directory in which
process.execPathresides to thePATH.According to the PR’s milestones, that’s npm >= 3.7.0 and >= 2.14.17, which have been bundled with Node.js >= 5.8.0 and >= 4.4.0 respectively… I’ve done a ton of digging on issues that were related to that change.
mhdawson commentedon Apr 25, 2016
@addaleax so if I read your statement correctly if the npm in the build tree was used then the child processes would be as well, right ?
addaleax commentedon Apr 25, 2016
@mhdawson I think so, yes. I’m definitely not an expert for the Node core side of npm testing, but the corresponding line to that change is there in
v4.x.