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

Unexpected curl download behavior #1556

Closed
PeterDaveHello opened this issue Jun 14, 2017 · 2 comments
Closed

Unexpected curl download behavior #1556

PeterDaveHello opened this issue Jun 14, 2017 · 2 comments
Labels
bugs Oh no, something's broken :-( installing node Issues with installing node/io.js versions.

Comments

@PeterDaveHello
Copy link
Collaborator

When downloading not exist files, wget fails as expected as below:

pi@raspberrypi ~ $ nvm i 0.12
Downloading and installing node v0.12.18...
Downloading https://nodejs.org/dist/v0.12.18/node-v0.12.18-linux-arm-pi.tar.xz...
--2017-06-14 10:37:32--  https://nodejs.org/dist/v0.12.18/node-v0.12.18-linux-arm-pi.tar.xz
Resolving nodejs.org (nodejs.org)... 104.20.23.46, 2400:cb00:2048:1::6814:172e, 2400:cb00:2048:1::6814:162e
Connecting to nodejs.org (nodejs.org)|104.20.23.46|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2017-06-14 10:37:34 ERROR 404: Not Found.

Binary download from https://nodejs.org/dist/v0.12.18/node-v0.12.18-linux-arm-pi.tar.xz failed, trying source.
grep: /home/pi/.nvm/.cache/bin/node-v0.12.18-linux-arm-pi/node-v0.12.18-linux-arm-pi.tar.xz: No such file or directory
Provided file to checksum does not exist.
Binary download failed, trying source.
Additional options while compiling: --without-snapshot
Downloading https://nodejs.org/dist/v0.12.18/node-v0.12.18.tar.xz...
--2017-06-14 10:37:34--  https://nodejs.org/dist/v0.12.18/node-v0.12.18.tar.xz
Resolving nodejs.org (nodejs.org)... 104.20.23.46, 104.20.22.46, 2400:cb00:2048:1::6814:172e, ...
Connecting to nodejs.org (nodejs.org)|104.20.23.46|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12334060 (12M) [application/x-xz]
Saving to: ‘/home/pi/.nvm/.cache/src/node-v0.12.18/node-v0.12.18.tar.xz’

However, curl, by default, will only save the 404 html content into the file, which misleads nvm think it downloaded with success:

Downloading and installing node v0.12.18...
Downloading https://nodejs.org/dist/v0.12.18/node-v0.12.18-linux-arm-pi.tar.xz...
######################################################################## 100.0%
Computing checksum with sha256sum
Provided checksum to compare to is empty.
xz: (stdin): File format not recognized
tar: Child returned status 1
tar: Error is not recoverable: exiting now
Binary download failed, trying source.
Additional options while compiling: --without-snapshot
Downloading https://nodejs.org/dist/v0.12.18/node-v0.12.18.tar.xz...
@ljharb
Copy link
Member

ljharb commented Jun 14, 2017

Is there an option to curl that can change this behavior?

@PeterDaveHello PeterDaveHello changed the title Unexpected download behavior Unexpected curl download behavior Jun 14, 2017
@PeterDaveHello
Copy link
Collaborator Author

@ljharb looks like --fail will do so.

@ljharb ljharb closed this as completed in 11370fe Jun 14, 2017
@ljharb ljharb added bugs Oh no, something's broken :-( installing node Issues with installing node/io.js versions. labels Jun 14, 2017
edwmurph pushed a commit to edwmurph/nvm that referenced this issue Apr 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugs Oh no, something's broken :-( installing node Issues with installing node/io.js versions.
Projects
None yet
Development

No branches or pull requests

2 participants