Nvm: Failed to install with curl

Created on 4 Apr 2020  路  8Comments  路  Source: nvm-sh/nvm

Unable to install with curl, failed to clone nvm repo. Instructed to report this.

Operating system and version:

Windows 10
Node v12.16.1

$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 13527  100 13527    0     0  13527      0  0:00:01 --:--:--  0:00:01 66635
=> Downloading nvm from git to '/c/Users/Adam/.nvm'
=> Cloning into 'C:/Users/Adam/.nvm'...
remote: Enumerating objects: 290, done.
remote: Counting objects: 100% (290/290), done.
remote: Compressing objects: 100% (257/257), done.
remote: Total 290 (delta 35), reused 97 (delta 20), pack-reused 0R
Receiving objects: 100% (290/290), 163.27 KiB | 5.27 MiB/s, done.
Resolving deltas: 100% (35/35), done.
error: unable to create file test/fast/Aliases/"nvm alias" should not accept aliases with slashes: Invalid argument
error: unable to create file test/fast/Aliases/"nvm unalias" should accept aliases when they shadow a built-in alias: Invalid argument
error: unable to create file test/fast/Aliases/"nvm unalias" should not accept aliases with names equal to built-in alias: Invalid argument
error: unable to create file test/fast/Aliases/"nvm unalias" should not accept aliases with slashes: Invalid argument
error: unable to create file test/fast/Aliases/Running "nvm alias <aliasname> <target>" again should change the target: Invalid argument
error: unable to create file test/fast/Aliases/Running "nvm alias <aliasname>" should list but one alias.: Invalid argument
error: unable to create file test/fast/Aliases/Running "nvm alias" lists implicit aliases when they do not exist: Invalid argument
error: unable to create file test/fast/Aliases/Running "nvm alias" lists manual aliases instead of implicit aliases when present: Invalid argument
error: unable to create file test/fast/Aliases/Running "nvm alias" should list all aliases.: Invalid argument
error: unable to create file test/fast/Aliases/lts/"nvm alias" should ensure LTS alias dir exists: Invalid argument
error: unable to create file test/fast/Listing paths/Running "nvm which 0.0.2" should display only version 0.0.2.: Invalid argument
error: unable to create file test/fast/Listing paths/Running "nvm which foo" should return a nonzero exit code when not found: Invalid argument
error: unable to create file test/fast/Listing versions/Running "nvm ls --no-alias" does not call into nvm_alias: Invalid argument
error: unable to create file test/fast/Listing versions/Running "nvm ls --no-alias" with a pattern errors: Invalid argument
error: unable to create file test/fast/Listing versions/Running "nvm ls 0.0.2" should display only version 0.0.2.: Invalid argument
error: unable to create file test/fast/Listing versions/Running "nvm ls 0.2" should display only 0.2.x versions.: Invalid argument
error: unable to create file test/fast/Listing versions/Running "nvm ls foo" should return a nonzero exit code when not found: Invalid argument
error: unable to create file test/fast/Listing versions/Running "nvm ls io" should return NA: Invalid argument
error: unable to create file test/fast/Listing versions/Running "nvm ls node_" should return a nonzero exit code when not found: Invalid argument
error: unable to create file test/fast/Listing versions/Running "nvm ls stable" and "nvm ls unstable" should return the appropriate implicit alias: Invalid argument
error: unable to create file test/fast/Listing versions/Running "nvm ls system" should include "system" when appropriate: Invalid argument
error: unable to create file test/fast/Listing versions/Running "nvm ls" calls into nvm_alias: Invalid argument
error: unable to create file test/fast/Listing versions/Running "nvm ls" should display all installed versions.: Invalid argument
error: unable to create file test/fast/Listing versions/Running "nvm ls" should filter out ".nvm": Invalid argument
error: unable to create file test/fast/Listing versions/Running "nvm ls" should filter out "versions": Invalid argument
error: unable to create file test/fast/Listing versions/Running "nvm ls" should include "system" when appropriate: Invalid argument
error: unable to create file test/fast/Listing versions/Running "nvm ls" should list versions in the "versions" directory: Invalid argument
error: unable to create file test/fast/Listing versions/Running "nvm ls" with node-like versioning vx.x.x should only list a matched version: Invalid argument
error: unable to create file test/fast/Listing versions/Running "nvm ls" with nounset should not fail.: Invalid argument
error: unable to create file test/fast/Running "nvm alias" should create a file in the alias directory.: Invalid argument
error: unable to create file test/fast/Running "nvm current" should display current nvm environment.: Invalid argument
error: unable to create file test/fast/Running "nvm deactivate" should unset the nvm environment variables.: Invalid argument
error: unable to create file test/fast/Running "nvm install" with "--reinstall-packages-from" requires a valid version: Invalid argument
error: unable to create file test/fast/Running "nvm install" with an invalid version fails nicely: Invalid argument
error: unable to create file test/fast/Running "nvm unalias" should remove the alias file.: Invalid argument
error: unable to create file test/fast/Running "nvm uninstall" should remove the appropriate directory.: Invalid argument
error: unable to create file test/fast/Running "nvm uninstall" with incorrect file permissions fails nicely: Invalid argument
error: unable to create file test/fast/Running "nvm unload" should unset all function and variables.: Invalid argument
error: unable to create file test/fast/Running "nvm use foo" where "foo" is circular aborts: Invalid argument
error: unable to create file test/fast/Running "nvm use iojs" uses latest io.js version: Invalid argument
error: unable to create file test/fast/Running "nvm use system" should work as expected: Invalid argument
error: unable to create file test/fast/Running "nvm use x" should create and change the "current" symlink: Invalid argument
error: unable to create file test/fast/Running "nvm use x" should not create the "current" symlink if $NVM_SYMLINK_CURRENT is false: Invalid argument
error: unable to create file test/fast/Running "nvm use" should drop CR char automatically.: Invalid argument
error: unable to create file test/slow/Running "nvm current" should display current nvm environment.: Invalid argument
error: unable to create file test/slow/nvm exec/Preamble works and respects "silent" flag: Invalid argument
error: unable to create file test/slow/nvm exec/Running "nvm exec --lts" should work: Invalid argument
error: unable to create file test/slow/nvm exec/Running "nvm exec 0.x" should work: Invalid argument
error: unable to create file test/slow/nvm exec/Running "nvm exec" should pick up .nvmrc version: Invalid argument
error: unable to create file test/slow/nvm reinstall-packages/Running "nvm copy-packages $(nvm ls current)" should error out: Invalid argument
error: unable to create file test/slow/nvm run/Running "nvm run --harmony --version" should work: Invalid argument
error: unable to create file test/slow/nvm run/Running "nvm run --lts" should work: Invalid argument
error: unable to create file test/slow/nvm run/Running "nvm run 0.x" should error out sensibly when 0.x is not installed: Invalid argument
error: unable to create file test/slow/nvm run/Running "nvm run 0.x" should work: Invalid argument
error: unable to create file test/slow/nvm run/Running "nvm run" should pick up .nvmrc version: Invalid argument
error: unable to create file test/slow/nvm uninstall/Running "nvm uninstall 0.12.6" uninstalls v0.12.6: Invalid argument
error: unable to create file test/slow/nvm uninstall/Running "nvm uninstall" with incorrect file permissions fails nicely: Invalid argument
error: unable to create file test/slow/nvm use/Running "nvm use --lts" uses latest LTS version: Invalid argument
error: unable to create file test/slow/nvm use/Running "nvm use --lts=foo" uses latest "foo" LTS version: Invalid argument
error: unable to create file test/slow/nvm use/Running "nvm use iojs" uses latest io.js version: Invalid argument
error: unable to create file test/slow/nvm use/Running "nvm use node" uses latest stable node version: Invalid argument
error: unable to create file test/slow/nvm use/Running "nvm use v1.0.0" uses iojs-v1.0.0 iojs version: Invalid argument
error: unable to create file test/slow/nvm use/Running "nvm use" calls "nvm_die_on_prefix": Invalid argument
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry the checkout with 'git checkout -f HEAD'

Failed to clone nvm repo. Please report this!

If you are having installation issues, or getting "N/A", what does curl -I --compressed -v https://nodejs.org/dist/ print out?


$ curl -I --compressed -v https://nodejs.org/dist/
* STATE: INIT => CONNECT handle 0x66e150; line 1418 (connection #-5000)
* Added connection 0. The cache now contains 1 members
* STATE: CONNECT => WAITRESOLVE handle 0x66e150; line 1454 (connection #0)
*   Trying 104.20.23.46...
* TCP_NODELAY set
* STATE: WAITRESOLVE => WAITCONNECT handle 0x66e150; line 1535 (connection #0)
* Connected to nodejs.org (104.20.23.46) port 443 (#0)
* STATE: WAITCONNECT => SENDPROTOCONNECT handle 0x66e150; line 1587 (connection #0)
* Marked for [keep alive]: HTTP default
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
  CApath: none
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* STATE: SENDPROTOCONNECT => PROTOCONNECT handle 0x66e150; line 1601 (connection #0)
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server accepted to use h2
* Server certificate:
*  subject: OU=Domain Control Validated; OU=PositiveSSL Wildcard; CN=*.nodejs.org
*  start date: Oct 21 00:00:00 2019 GMT
*  expire date: Jan 18 23:59:59 2022 GMT
*  subjectAltName: host "nodejs.org" matched cert's "nodejs.org"
*  issuer: C=GB; ST=Greater Manchester; L=Salford; O=Sectigo Limited; CN=Sectigo RSA Domain Validation Secure Server CA
*  SSL certificate verify ok.
* STATE: PROTOCONNECT => DO handle 0x66e150; line 1622 (connection #0)
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* nghttp2_session_mem_recv() returns 0
* http2_send len=110
* h2 header: :method:HEAD
* h2 header: :path:/dist/
* h2 header: :scheme:https
* h2 header: :authority:nodejs.org
* h2 header: User-Agent:curl/7.57.0
* h2 header: Accept:*/*
* h2 header: Accept-Encoding:deflate, gzip
* Using Stream ID: 1 (easy handle 0x66e150)
* before_frame_send() was called
* on_frame_send() was called, length = 51
> HEAD /dist/ HTTP/2
> Host: nodejs.org
> User-Agent: curl/7.57.0
> Accept: */*
> Accept-Encoding: deflate, gzip
>
* STATE: DO => DO_DONE handle 0x66e150; line 1684 (connection #0)
* multi changed, check CONNECT_PEND queue!
* STATE: DO_DONE => WAITPERFORM handle 0x66e150; line 1809 (connection #0)
* STATE: WAITPERFORM => PERFORM handle 0x66e150; line 1825 (connection #0)
* http2_recv: easy 0x66e150 (stream 1)
* nread=40
* Got SETTINGS
* MAX_CONCURRENT_STREAMS == 256
* ENABLE_PUSH == TRUE
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
* nghttp2_session_mem_recv() returns 40
* All data in connection buffer processed
* http2_recv returns AGAIN for stream 1
* multi changed, check CONNECT_PEND queue!
* http2_recv: easy 0x66e150 (stream 1)
* nread=9
* Got SETTINGS
* MAX_CONCURRENT_STREAMS == 256
* ENABLE_PUSH == TRUE
* nghttp2_session_mem_recv() returns 9
* All data in connection buffer processed
* http2_recv returns AGAIN for stream 1
* http2_recv: easy 0x66e150 (stream 1)
* nread=304
* on_begin_headers() was called
* h2 status: HTTP/2 200 (easy 0x66e150)
* h2 header: date: Sat, 04 Apr 2020 18:34:03 GMT
* h2 header: content-type: text/html
* h2 header: set-cookie: __cfduid=db072303ae51cd084d2fc7b0ff9a3b5291586025243; expires=Mon, 04-May-20 18:34:03 GMT; path=/; domain=.nodejs.org; HttpOnly; SameSite=Lax
* h2 header: cache-control: max-age=14400
* h2 header: cf-cache-status: HIT
* h2 header: age: 121
* h2 header: expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
* h2 header: vary: Accept-Encoding
* h2 header: server: cloudflare
* h2 header: cf-ray: 57ed1f08ffa3cf38-IAD
* h2 header: content-encoding: gzip
* on_frame_recv() header 1 stream 1
* Store 491 bytes headers from stream 1 at 0x6773d0
* on_stream_close(), NO_ERROR (err 0), stream 1
* Removed stream 1 hash!
* nghttp2_session_mem_recv() returns 304
* All data in connection buffer processed
* http2_recv: returns 491 for stream 1
* HTTP/2 found, allow multiplexing
< HTTP/2 200
HTTP/2 200
< date: Sat, 04 Apr 2020 18:34:03 GMT
date: Sat, 04 Apr 2020 18:34:03 GMT
< content-type: text/html
content-type: text/html
< set-cookie: __cfduid=db072303ae51cd084d2fc7b0ff9a3b5291586025243; expires=Mon, 04-May-20 18:34:03 GMT; path=/; domain=.nodejs.org; HttpOnly; SameSite=Lax
set-cookie: __cfduid=db072303ae51cd084d2fc7b0ff9a3b5291586025243; expires=Mon, 04-May-20 18:34:03 GMT; path=/; domain=.nodejs.org; HttpOnly; SameSite=Lax
< cache-control: max-age=14400
cache-control: max-age=14400
< cf-cache-status: HIT
cf-cache-status: HIT
< age: 121
age: 121
< expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
< vary: Accept-Encoding
vary: Accept-Encoding
< server: cloudflare
server: cloudflare
< cf-ray: 57ed1f08ffa3cf38-IAD
cf-ray: 57ed1f08ffa3cf38-IAD
< content-encoding: gzip
content-encoding: gzip

<
* STATE: PERFORM => DONE handle 0x66e150; line 1994 (connection #0)
* multi_done
* free header_recvbuf!!
* Connection #0 to host nodejs.org left intact
* Expire cleared

windows non-issue / invalid

Most helpful comment

Since today our CI has an error when downloading a node version with NVM:

#!/bin/bash -eo pipefail
nvm install v10.16.2
nvm alias default v10.16.2
Downloading https://nodejs.org/dist/v10.16.2/node-v10.16.2-linux-x64.tar.xz...
######################################################################## 100.0%
Checksums empty
xz: (stdin): File format not recognized
tar: Child returned status 1
tar: Error is not recoverable: exiting now
Binary download failed, trying source.
######################################################################## 100.0%
Checksums empty

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
Binary download failed, trying source.
Detected that you have 2 CPU thread(s)
Number of CPU thread(s) less or equal to 2 will have only one job a time for 'make'
Installing node v1.0 and greater from source is not currently supported

Exited with code exit status 106

All 8 comments

Note that nvm isn't compatible with windows unless using WSL. Are you?

(Also possibly related to #1643)

on this #1643, you can avoid curl and use this alternative:

nvm has been available to windows users to manage multiple installations of node.js
on a Windows computer since 2017. Chocolatey is a software management solution
unlike anything else you've ever experienced on Windows. It brings the concepts
of true package management to allow you to version things, manage dependencies and
installation order, better inventory management, and other features. Its also very easy to
install, after installing it, you can do the following in an elevated comman prompt:

choco install nvm
choco upgrade nvm

@Akagutz that is NOT this project; that's nvm-windows, a completely different project with a different featureset.

Since today our CI has an error when downloading a node version with NVM:

#!/bin/bash -eo pipefail
nvm install v10.16.2
nvm alias default v10.16.2
Downloading https://nodejs.org/dist/v10.16.2/node-v10.16.2-linux-x64.tar.xz...
######################################################################## 100.0%
Checksums empty
xz: (stdin): File format not recognized
tar: Child returned status 1
tar: Error is not recoverable: exiting now
Binary download failed, trying source.
######################################################################## 100.0%
Checksums empty

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
Binary download failed, trying source.
Detected that you have 2 CPU thread(s)
Number of CPU thread(s) less or equal to 2 will have only one job a time for 'make'
Installing node v1.0 and greater from source is not currently supported

Exited with code exit status 106

Note that nvm isn't compatible with windows unless using WSL. Are you?

(Also possibly related to #1643)

I'm not on WSL no, but I do have nvm set up on my work laptop which isn't either. It's possible I used a shell other than bash to install (cmder).

@BorntraegerMarc this is entirely unrelated to nvm; see https://github.com/nodejs/build/issues/2263

@aspecker it's almost certain then that you're using nvm-windows, since proper nvm (this repo) requires an actual POSIX shell to install - it won't work whatsoever on cmder.

Yeah that seems about right. Thanks for your help.

Was this page helpful?
0 / 5 - 0 ratings