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 install/node-gyp rebuild fails on 8.1.1 (wrong dist-url) #13667

Closed
theverything opened this issue Jun 14, 2017 · 21 comments
Closed

npm install/node-gyp rebuild fails on 8.1.1 (wrong dist-url) #13667

theverything opened this issue Jun 14, 2017 · 21 comments

Comments

@theverything
Copy link

theverything commented Jun 14, 2017

  • Version: 8.1.1
  • Platform: Darwin theverything-mbpr 16.5.0 Darwin Kernel Version 16.5.0: Fri Mar 3 16:52:33 PST 2017; root:xnu-3789.51.2~3/RELEASE_X86_64 x86_64
  • Subsystem: node-gyp

run

npm --build-from-source install fsevents


Edit (by @gibfahn):

Workaround is (see @addaleax's tweet):

npm config set dist-url https://nodejs.org/download/release/

This will be fixed in the next Node 8.x release.

@bhj
Copy link

bhj commented Jun 14, 2017

Error: 404 response downloading https://nodejs.org/download//v8.1.1/node-v8.1.1-headers.tar.gz

@mscdex mscdex added the npm Issues and PRs related to the npm client dependency or the npm registry. label Jun 14, 2017
@refack
Copy link
Contributor

refack commented Jun 14, 2017

@theverything are you seeing the same as @bhj? could you paste the whole npm output? even better run npm --build-from-source install fsevents --verbose?
BTW: this looks like a bug in node-gyp not in node core, so maybe an npm up npm -g might help.

@refack refack self-assigned this Jun 14, 2017
@refack refack added the macos Issues and PRs related to the macOS platform / OSX. label Jun 14, 2017
@bnoordhuis
Copy link
Member

bnoordhuis commented Jun 14, 2017

See nodejs/node-gyp#1230, the embedded download URL in v8.1.1 is wrong:

$ ./node-v8.1.0-darwin-x64/bin/node -p process.release
{ name: 'node',
  sourceUrl: 'https://nodejs.org/download/release/v8.1.0/node-v8.1.0.tar.gz',
  headersUrl: 'https://nodejs.org/download/release/v8.1.0/node-v8.1.0-headers.tar.gz' }

$ ./node-v8.1.1-darwin-x64/bin/node -p process.release
{ name: 'node',
  sourceUrl: 'https://nodejs.org/download//v8.1.1/node-v8.1.1.tar.gz',
  headersUrl: 'https://nodejs.org/download//v8.1.1/node-v8.1.1-headers.tar.gz' }

As a workaround, you can install with:

$ npm install --dist-url https://nodejs.org/download/release

cc @addaleax - might be worth doing a new release for. I'll remove the npm and macos labels.

@bnoordhuis bnoordhuis removed macos Issues and PRs related to the macOS platform / OSX. npm Issues and PRs related to the npm client dependency or the npm registry. labels Jun 14, 2017
@addaleax addaleax added the v8.x label Jun 14, 2017
@addaleax
Copy link
Member

cc @addaleax - might be worth doing a new release for

Yeah, maybe … @nodejs/release @jasnell I’m not quite sure how this happened? The default url base in the source code is https://nodejs.org/download/release/, so I guess something was passed to ./configure to override that when building the release?

@gibfahn
Copy link
Member

gibfahn commented Jun 14, 2017

I think this is an issue in the ci-release job configure script. There's this code:

RELEASE_URLBASE=https://nodejs.org/download/${DISTTYPE}/
if [ "X${disttype}" == "Xtest" ]; then
  disttype=custom
  CUSTOMTAG="test${datestring}${commit}"
  RELEASE_URLBASE=https://nodejs.org/download/test/
elif [ "X${disttype}" == "Xv8-canary" ]; then
  disttype=custom
  CUSTOMTAG="v8-canary${datestring}${commit}"
  RELEASE_URLBASE=https://nodejs.org/download/v8-canary/
elif [ "X${disttype}" == "Xrc" ]; then
  disttype=custom
  CUSTOMTAG="rc.$rc"
  RELEASE_URLBASE=https://nodejs.org/download/rc/
fi

# ...

make -j 2 binary-upload \
  DESTCPU="$DESTCPU" \
  ARCH="$ARCH" \
  DISTTYPE="$disttype" \
  DATESTRING="$datestring" \
  COMMIT="$commit" \
  CUSTOMTAG="$CUSTOMTAG" \
  RELEASE_URLBASE="$RELEASE_URLBASE" \
  CONFIG_FLAGS="$CONFIG_FLAGS"

but the env var we pass in is disttype not DISTTYPE, so the RELEASE_URLBASE gets set wrong.

I think the best thing to do is just to uppercase DISTTYPE everything everywhere, that way we don't have this confusing mix.

cc/ @nodejs/build

@refack
Copy link
Contributor

refack commented Jun 14, 2017

The Windows release is unaffected:

D:\code$ node -p process.release
{ name: 'node',
  sourceUrl: 'https://nodejs.org/download/release/v8.1.1/node-v8.1.1.tar.gz',
  headersUrl: 'https://nodejs.org/download/release/v8.1.1/node-v8.1.1-headers.tar.gz',
  libUrl: 'https://nodejs.org/download/release/v8.1.1/win-x64/node.lib' }

@gibfahn
Copy link
Member

gibfahn commented Jun 14, 2017

The Windows release is unaffected:

Yep, that's a different script (and windows env vars aren't case-sensitive).

@ralphtheninja
Copy link
Contributor

This is bad guys 😞 Basically breaks all native modules for non windows since node-gyp will fail to download headers for 8.1.1, but luckily the workaround works fine.

@kyrylkov
Copy link

Is an urgent bug fix release planned for this?

@jasnell
Copy link
Member

jasnell commented Jun 14, 2017

No idea how this happened either. A change to the ci-release script is the only thing I can imagine. That's a bit troubling.

@theverything
Copy link
Author

@refack yeah I'm seeing the same thing

@fiznool
Copy link

fiznool commented Jun 14, 2017

Workaround if you are deploying to heroku:

heroku config:set NPM_CONFIG_DISTURL=https://nodejs.org/download/release/

@gibfahn gibfahn changed the title npm install fsevents fails when upgrading to 8.1.1 npm install/node-gyp rebuild fails on 8.1.1 (wrong dist-url) Jun 14, 2017
@gibfahn
Copy link
Member

gibfahn commented Jun 14, 2017

Changed title to (in theory) improve discoverability.

@jrforrest
Copy link

@fiznool nice find on the env var for the workaround.

Just want to mention that folks on Heroku should be sure to unset the var on next node release to avoid another difficult to diagnose build breakage in the future if the release host changes.

@ilkkao
Copy link

ilkkao commented Jun 15, 2017

In the meantime, can the web server be configured to handle this incorrect URL?

@rvagg
Copy link
Member

rvagg commented Jun 15, 2017

I'm going to have to take the blame for this. It's a result of my refactoring of the main Jenkins build job to accommodate the new v8-canary builds. I'll push a speedy 8.1.2 release with only a version bump to take care of this unless anyone objects to that course of action.

@addaleax
Copy link
Member

I'll push a speedy 8.1.2 release with only a version bump to take care of this unless anyone objects to that course of action.

@rvagg Thank you, that would be great. :) Doing that has been suggested here before and nobody objected, so I think it’s safe to say you have our blessings.

@rvagg
Copy link
Member

rvagg commented Jun 15, 2017

Building, I'll test the binaries before promoting them to make sure I have it right!

rvagg added a commit that referenced this issue Jun 15, 2017
Release to fix broken `process.release` properties
Ref: #13667
refack added a commit to refack/build that referenced this issue Jun 15, 2017
@rvagg
Copy link
Member

rvagg commented Jun 15, 2017

Out in a redirect for https://nodejs.org/download//v8.1.1/node-v8.1.1-headers.tar.gz and https://nodejs.org/download//v8.1.1/SHASUMS256.txt as has been suggested in this thread already. Confirmed working (thankfully node-gyp uses request which follows redirects automatically). So the problem should be solved for now for everyone. But, as is being discussed over in #13667 we probably won't leave this redirect in place permanently, just considering it as a band-aid solution for now.

Still working on an 8.1.2, should be out shortly.

rvagg added a commit that referenced this issue Jun 15, 2017
Release to fix broken `process.release` properties
Ref: #13667
@rvagg
Copy link
Member

rvagg commented Jun 15, 2017

8.1.2 out @ https://nodejs.org/en/blog/release/v8.1.2/

armv6 still building, will promote later

@refack
Copy link
Contributor

refack commented Jun 15, 2017

In the meantime, can the web server be configured to handle this incorrect URL?

@ilkkao that was a good idea, very Web 2.0 (that was a thing). I'm feeling old that I was stuck in the filesystem metaphor 👴

AdamMajer added a commit to AdamMajer/nodejs-packaging that referenced this issue Jun 19, 2017
Release to fix broken process.release properties
Ref: nodejs/node#13667
@refack refack removed their assignment Oct 24, 2018
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