nvm install --lts failed

Created on 13 Dec 2017  路  17Comments  路  Source: nvm-sh/nvm

  • Operating system and version:
    osx 10.12.6

  • nvm debug output:


nvm --version: v0.33.0
$SHELL: /bin/bash
$HOME: /Users/ruiguo
$NVM_DIR: '$HOME/.nvm'
$PREFIX: ''
$NPM_CONFIG_PREFIX: ''
nvm current: system
which node: /usr/local/bin/node
which iojs: 
which npm: /usr/local/bin/npm
npm config get prefix: /usr/local
npm root -g: /usr/local/lib/node_modules

  • nvm ls output:

->       system
node -> stable (-> N/A) (default)
iojs -> N/A (default)
grep: brackets ([ ]) not balanced
sed: 8: "
            s#/Users/r ...": unbalanced brackets ([])
lts/* -> lts/<![endif]--> (-> N/A)
sed: 8: "
            s#/Users/r ...": unbalanced brackets ([])
lts/<![endif]--> -> <!--[if (-> N/A)
sed: 8: "
            s#/Users/r ...": unbalanced brackets ([])
lts/><![endif]--> -> <!--[if (-> N/A)

Installing latest LTS version.

Detected that you have 4 CPU core(s)

Running with 3 threads to speed up the build

grep: brackets ([ ]) not balanced

Downloading https://nodejs.org/dist/node-<!--[if.tar.gz...

curl: (3) [globbing] bad range in column 35

Binary download from https://nodejs.org/dist/node-<!--[if.tar.gz failed, trying source.

grep: /Users/ruiguo/.nvm/.cache/src/node-<!--[if/node-<!--[if.tar.gz: No such file or directory

Provided file to checksum does not exist.

nvm: install <!--[if failed!
  • What did you expect to happen?
    How to install?
  • Is there anything in any of your profile files (.bashrc, .bash_profile, .zshrc, etc) that modifies the PATH?
    I think that does not matter
  • 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/
*   Trying 104.20.22.46...
* TCP_NODELAY set
*   Trying 2400:cb00:2048:1::6814:172e...
* TCP_NODELAY set
* Immediate connect fail for 2400:cb00:2048:1::6814:172e: No route to host
*   Trying 2400:cb00:2048:1::6814:162e...
* TCP_NODELAY set
* Immediate connect fail for 2400:cb00:2048:1::6814:162e: No route to host
* Connected to nodejs.org (104.20.22.46) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* Server certificate: *.nodejs.org
* Server certificate: COMODO RSA Domain Validation Secure Server CA
* Server certificate: COMODO RSA Certification Authority
> HEAD /dist/ HTTP/1.1
> Host: nodejs.org
> User-Agent: curl/7.54.0
> Accept: */*
> Accept-Encoding: deflate, gzip
> 
< HTTP/1.1 403 Forbidden
HTTP/1.1 403 Forbidden
< Date: Wed, 13 Dec 2017 03:15:50 GMT
Date: Wed, 13 Dec 2017 03:15:50 GMT
< Content-Type: text/html; charset=UTF-8
Content-Type: text/html; charset=UTF-8
< Connection: close
Connection: close
< Set-Cookie: __cfduid=d4f20af1753e377233a26c51bb06607dd1513134950; expires=Thu, 13-Dec-18 03:15:50 GMT; path=/; domain=.nodejs.org; HttpOnly
Set-Cookie: __cfduid=d4f20af1753e377233a26c51bb06607dd1513134950; expires=Thu, 13-Dec-18 03:15:50 GMT; path=/; domain=.nodejs.org; HttpOnly
< CF-Chl-Bypass: 1
CF-Chl-Bypass: 1
< Cache-Control: max-age=2
Cache-Control: max-age=2
< Expires: Wed, 13 Dec 2017 03:15:52 GMT
Expires: Wed, 13 Dec 2017 03:15:52 GMT
< X-Frame-Options: SAMEORIGIN
X-Frame-Options: SAMEORIGIN
< Server: cloudflare-nginx
Server: cloudflare-nginx
< CF-RAY: 3cc5c2debc9b2876-SJC
CF-RAY: 3cc5c2debc9b2876-SJC

< 
* Closing connection 0

Mac OS needs followup bassh

Most helpful comment

Great! It works, and thank you for your quick response!

All 17 comments

@bzvew you're using nvm v0.33.0 - could you try upgrading to v0.33.8, the latest?

Separately, what does type grep print out?

I update, then try nvm ls

nvm ls

->       system
node -> stable (-> N/A) (default)
iojs -> N/A (default)
grep: brackets ([ ]) not balanced
sed: 8: "
            s#/Users/r ...": unbalanced brackets ([])
lts/* -> lts/<![endif]--> (-> N/A)
sed: 8: "
            s#/Users/r ...": unbalanced brackets ([])
lts/<![endif]--> -> <!--[if (-> N/A)
sed: 8: "
            s#/Users/r ...": unbalanced brackets ([])
lts/><![endif]--> -> <!--[if (-> N/A)



type grep
grep is /usr/bin/grep

what about type sed?

I'm confused where <![endif]--> comes from; that's not in nvm's source code at all.

type sed
sed is hashed (/usr/bin/sed)

I'm wondering if there was a hiccup with the contents of nodejs.org - can you try running nvm ls-remote again (which will recreate your local LTS aliases)?

nvm ls-remote

        v0.1.14
        v0.1.15
        v0.1.16
        v0.1.17
        v0.1.18
        v0.1.19
        v0.1.20
        v0.1.21
        v0.1.22
        v0.1.23
        v0.1.24
        v0.1.25
        v0.1.26
        v0.1.27
        v0.1.28
        v0.1.29
        v0.1.30
        v0.1.31
        v0.1.32
        v0.1.33
        v0.1.90
        v0.1.91
        v0.1.92
        v0.1.93
        v0.1.94
        v0.1.95
        v0.1.96
        v0.1.97
        v0.1.98
        v0.1.99
       v0.1.100
       v0.1.101
       v0.1.102
       v0.1.103
       v0.1.104
         v0.2.0
         v0.2.1
         v0.2.2
         v0.2.3
         v0.2.4
         v0.2.5
         v0.2.6
         v0.3.0
         v0.3.1
         v0.3.2
         v0.3.3
         v0.3.4
         v0.3.5
         v0.3.6
         v0.3.7
         v0.3.8
         v0.4.0
         v0.4.1
         v0.4.2
         v0.4.3
         v0.4.4
         v0.4.5
         v0.4.6
         v0.4.7
         v0.4.8
         v0.4.9
        v0.4.10
        v0.4.11
        v0.4.12
         v0.5.0
         v0.5.1
         v0.5.2
         v0.5.3
         v0.5.4
         v0.5.5
         v0.5.6
         v0.5.7
         v0.5.8
         v0.5.9
        v0.5.10
         v0.6.0
         v0.6.1
         v0.6.2
         v0.6.3
         v0.6.4
         v0.6.5
         v0.6.6
         v0.6.7
         v0.6.8
         v0.6.9
        v0.6.10
        v0.6.11
        v0.6.12
        v0.6.13
        v0.6.14
        v0.6.15
        v0.6.16
        v0.6.17
        v0.6.18
        v0.6.19
        v0.6.20
        v0.6.21
         v0.7.0
         v0.7.1
         v0.7.2
         v0.7.3
         v0.7.4
         v0.7.5
         v0.7.6
         v0.7.7
         v0.7.8
         v0.7.9
        v0.7.10
        v0.7.11
        v0.7.12
         v0.8.0
         v0.8.1
         v0.8.2
         v0.8.3
         v0.8.4
         v0.8.5
         v0.8.6
         v0.8.7
         v0.8.8
         v0.8.9
        v0.8.10
        v0.8.11
        v0.8.12
        v0.8.13
        v0.8.14
        v0.8.15
        v0.8.16
        v0.8.17
        v0.8.18
        v0.8.19
        v0.8.20
        v0.8.21
        v0.8.22
        v0.8.23
        v0.8.24
        v0.8.25
        v0.8.26
        v0.8.27
        v0.8.28
         v0.9.0
         v0.9.1
         v0.9.2
         v0.9.3
         v0.9.4
         v0.9.5
         v0.9.6
         v0.9.7
         v0.9.8
         v0.9.9
        v0.9.10
        v0.9.11
        v0.9.12
        v0.10.0
        v0.10.1
        v0.10.2
        v0.10.3
        v0.10.4
        v0.10.5
        v0.10.6
        v0.10.7
        v0.10.8
        v0.10.9
       v0.10.10
       v0.10.11
       v0.10.12
       v0.10.13
       v0.10.14
       v0.10.15
       v0.10.16
       v0.10.17
       v0.10.18
       v0.10.19
       v0.10.20
       v0.10.21
       v0.10.22
       v0.10.23
       v0.10.24
       v0.10.25
       v0.10.26
       v0.10.27
       v0.10.28
       v0.10.29
       v0.10.30
       v0.10.31
       v0.10.32
       v0.10.33
       v0.10.34
       v0.10.35
       v0.10.36
       v0.10.37
       v0.10.38
       v0.10.39
       v0.10.40
       v0.10.41
       v0.10.42
       v0.10.43
       v0.10.44
       v0.10.45
       v0.10.46
       v0.10.47
       v0.10.48
        v0.11.0
        v0.11.1
        v0.11.2
        v0.11.3
        v0.11.4
        v0.11.5
        v0.11.6
        v0.11.7
        v0.11.8
        v0.11.9
       v0.11.10
       v0.11.11
       v0.11.12
       v0.11.13
       v0.11.14
       v0.11.15
       v0.11.16
        v0.12.0
        v0.12.1
        v0.12.2
        v0.12.3
        v0.12.4
        v0.12.5
        v0.12.6
        v0.12.7
        v0.12.8
        v0.12.9
       v0.12.10
       v0.12.11
       v0.12.12
       v0.12.13
       v0.12.14
       v0.12.15
       v0.12.16
       v0.12.17
       v0.12.18
         v4.0.0
         v4.1.0
         v4.1.1
         v4.1.2
         v4.2.0   (LTS: Argon)
         v4.2.1   (LTS: Argon)
         v4.2.2   (LTS: Argon)
         v4.2.3   (LTS: Argon)
         v4.2.4   (LTS: Argon)
         v4.2.5   (LTS: Argon)
         v4.2.6   (LTS: Argon)
         v4.3.0   (LTS: Argon)
         v4.3.1   (LTS: Argon)
         v4.3.2   (LTS: Argon)
         v4.4.0   (LTS: Argon)
         v4.4.1   (LTS: Argon)
         v4.4.2   (LTS: Argon)
         v4.4.3   (LTS: Argon)
         v4.4.4   (LTS: Argon)
         v4.4.5   (LTS: Argon)
         v4.4.6   (LTS: Argon)
         v4.4.7   (LTS: Argon)
         v4.5.0   (LTS: Argon)
         v4.6.0   (LTS: Argon)
         v4.6.1   (LTS: Argon)
         v4.6.2   (LTS: Argon)
         v4.7.0   (LTS: Argon)
         v4.7.1   (LTS: Argon)
         v4.7.2   (LTS: Argon)
         v4.7.3   (LTS: Argon)
         v4.8.0   (LTS: Argon)
         v4.8.1   (LTS: Argon)
         v4.8.2   (LTS: Argon)
         v4.8.3   (LTS: Argon)
         v4.8.4   (LTS: Argon)
         v4.8.5   (LTS: Argon)
         v4.8.6   (LTS: Argon)
         v4.8.7   (Latest LTS: Argon)
         v5.0.0
         v5.1.0
         v5.1.1
         v5.2.0
         v5.3.0
         v5.4.0
         v5.4.1
         v5.5.0
         v5.6.0
         v5.7.0
         v5.7.1
         v5.8.0
         v5.9.0
         v5.9.1
        v5.10.0
        v5.10.1
        v5.11.0
        v5.11.1
        v5.12.0
         v6.0.0
         v6.1.0
         v6.2.0
         v6.2.1
         v6.2.2
         v6.3.0
         v6.3.1
         v6.4.0
         v6.5.0
         v6.6.0
         v6.7.0
         v6.8.0
         v6.8.1
         v6.9.0   (LTS: Boron)
         v6.9.1   (LTS: Boron)
         v6.9.2   (LTS: Boron)
         v6.9.3   (LTS: Boron)
         v6.9.4   (LTS: Boron)
         v6.9.5   (LTS: Boron)
        v6.10.0   (LTS: Boron)
        v6.10.1   (LTS: Boron)
        v6.10.2   (LTS: Boron)
        v6.10.3   (LTS: Boron)
        v6.11.0   (LTS: Boron)
        v6.11.1   (LTS: Boron)
        v6.11.2   (LTS: Boron)
        v6.11.3   (LTS: Boron)
        v6.11.4   (LTS: Boron)
        v6.11.5   (LTS: Boron)
        v6.12.0   (LTS: Boron)
        v6.12.1   (LTS: Boron)
        v6.12.2   (Latest LTS: Boron)
         v7.0.0
         v7.1.0
         v7.2.0
         v7.2.1
         v7.3.0
         v7.4.0
         v7.5.0
         v7.6.0
         v7.7.0
         v7.7.1
         v7.7.2
         v7.7.3
         v7.7.4
         v7.8.0
         v7.9.0
        v7.10.0
        v7.10.1
         v8.0.0
         v8.1.0
         v8.1.1
         v8.1.2
         v8.1.3
         v8.1.4
         v8.2.0
         v8.2.1
         v8.3.0
         v8.4.0
         v8.5.0
         v8.6.0
         v8.7.0
         v8.8.0
         v8.8.1
         v8.9.0   (LTS: Carbon)
         v8.9.1   (LTS: Carbon)
         v8.9.2   (LTS: Carbon)
         v8.9.3   (Latest LTS: Carbon)
         v9.0.0
         v9.1.0
         v9.2.0
         v9.2.1
         v9.3.0

Then I try
nvm ls

->       system
node -> stable (-> N/A) (default)
iojs -> N/A (default)
lts/* -> lts/carbon (-> N/A)
sed: 8: "
            s#/Users/r ...": unbalanced brackets ([])
lts/<![endif]--> -> <!--[if (-> N/A)
sed: 8: "
            s#/Users/r ...": unbalanced brackets ([])
lts/><![endif]--> -> <!--[if (-> N/A)
lts/argon -> v4.8.7 (-> N/A)
lts/boron -> v6.12.2 (-> N/A)
lts/carbon -> v8.9.3 (-> N/A)

I assume if you run nvm alias, you get similar output?

If you cd into $NVM_DIR/alias, what files are present and what are their contents?

nvm alias
node -> stable (-> N/A) (default)
iojs -> N/A (default)
lts/* -> lts/carbon (-> N/A)
sed: 8: "
            s#/Users/r ...": unbalanced brackets ([])
lts/<![endif]--> -> <!--[if (-> N/A)
sed: 8: "
            s#/Users/r ...": unbalanced brackets ([])
lts/><![endif]--> -> <!--[if (-> N/A)
lts/argon -> v4.8.7 (-> N/A)
lts/boron -> v6.12.2 (-> N/A)
lts/carbon -> v8.9.3 (-> N/A)


cd $NVM_DIR/alias
ls -lh
drwxr-xr-x  8 ruiguo  staff   272B Dec 13 15:39 lts

I installed via brew this morning and it worked fine.

OSX Version: 10.13.2 (17C88)

@gedw99 nvm is completely unsupported when installed with homebrew (which the formula tells you in your terminal); please install it using the only proper method (in the readme).

@bzvew thanks; and what are all the filenames in $NVM_DIR/alias/lts/ and their contents?

ls -lR $NVM_DIR/alias/lts/
total 48
-rw-r--r--  1 ruiguo  staff  11 Dec 13 15:39 *
-rw-r--r--  1 ruiguo  staff   8 Dec 13 11:07 <![endif]-->
-rw-r--r--  1 ruiguo  staff   8 Dec 13 11:07 ><![endif]-->
-rw-r--r--  1 ruiguo  staff   7 Dec 13 15:39 argon
-rw-r--r--  1 ruiguo  staff   8 Dec 13 15:39 boron
-rw-r--r--  1 ruiguo  staff   7 Dec 13 15:39 carbon

there we go. I have no idea what's going on with that, but can you run rm -rf "$NVM_DIR/alias/lts" && nvm ls-remote? After that, I'd expect everything to work.

Great! It works, and thank you for your quick response!

I'm going to leave this open, since nvm shouldn't be this brittle in the event of nodejs.org corruption.

@ljharb thanks. Did not knwo.. good stuff.

@ljharb

am getting this from my Makefile:

``` bash -l -c 'nvm exec v8.9.3 yarn add --save deck.gl luma.gl' Environment: nvm is not compatible with the npm config "prefix" option: currently set to "/usr/local" Runnpm config delete prefixornvm use --delete-prefix v6.11.2 --silent` to unset it.

````

bash_profile:
export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm echoLog "Nvm (node)" $NVM_DIR

I tried doing the npm config delete prefix and nvm use --delete-prefix v6.11.2 --silent, but neither changes the result.

hope this helps


Update i fixed it

  1. updated to latest nvm
  2. removed the start script from .bashrc and left it in .bash_profile

all good now

Was this page helpful?
0 / 5 - 0 ratings