Nvm: NVM install node freezes

Created on 20 Sep 2017  路  15Comments  路  Source: nvm-sh/nvm

  • Operating system and version:
    Centos 7.3 - latest

  • nvm debug output:


> [nodejs@m5465 ~]$ nvm debug
> nvm --version: v0.33.4
> $SHELL: /bin/bash
> $HOME: /home/nodejs
> $NVM_DIR: '$HOME/.nvm'
> $PREFIX: ''
> $NPM_CONFIG_PREFIX: ''
> $NVM_NODEJS_ORG_MIRROR: ''
> $NVM_IOJS_ORG_MIRROR: ''
> shell version: 'GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu)'
> uname -a: 'Linux 3.10.0-693.2.2.el7.x86_64 #1 SMP Tue Sep 12 22:26:13 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux'
> OS version:
> curl: /usr/bin/curl, curl 7.29.0 (x86_64-redhat-linux-gnu) libcurl/7.29.0 NSS/3.28.4 zlib/1.2.7 libidn/1.28 libssh2/1.4.3
> wget: /usr/bin/wget, GNU Wget 1.14 built on linux-gnu.
> git: /usr/bin/git, git version 1.8.3.1
> nvm current: none
> which node: which: no node in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)
> which iojs: which: no iojs in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)
> which npm: which: no npm in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)
> npm config get prefix: bash: npm: command not found
> npm root -g: bash: npm: command not found

  • nvm ls output:


  • How did you install nvm? (e.g. install script in readme, homebrew):
    install script from readme
    command -v nvm <- Returned "nvm", so apparently nvm was installed correctly

  • What steps did you perform?
    nvm install node

  • What happened?
    Nothing, apparently it freezes and the bash console doesn't accept new commands until i ctrl + c

  • What did you expect to happen?
    That nvm would install node

  • Is there anything in any of your profile files (.bashrc, .bash_profile, .zshrc, etc) that modifies the PATH?
    No it's a fresh Centos installation.

centos installing node needs followup

Most helpful comment

I had this same issue, and since it's the first Google result, I figure I'd mention what my issue was.

The command mentioned above told me that my system was using IPv6 by default to pull the releases, as it simply hung at an IPv6 address after running it. That command again is:

curl --fail --compressed -q -L -s https://iojs.org/dist/index.tab -o - --verbose

I do not have this issue on my other servers, but in this particular situation, I was attempting to install nvm within an internal network at my place of work. And seeing as I am unable to personally troubleshoot and configure IPv6, I had no other choice than to simply disable it on my CentOS 7 system. This fixed my issue, though I hate to resort to disabling IPv6.

To test if this may also be your issue, run the same command as above, but simply append --ipv4 on it:

curl --fail --compressed -q -L -s https://iojs.org/dist/index.tab -o - --verbose --ipv4

If it successfully pulls down the releases, I would suggest either troubleshooting your IPv6 configurations, or if you're in a situation like mine where you have no control over them, simply disable IPv6 on your server.

Hope this helps anyone else who runs into this.

All 15 comments

What version of CentOS are you using?

     Icon name: computer-server
       Chassis: server
    Machine ID: 61d8569e70c54005ad49ed271a5a08d8
       Boot ID: 0ec6c72691cb47718ec7d3bf1be2276f

Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-693.2.2.el7.x86_64
Architecture: x86-64

If you try set -x; nvm install node, can you provide the output in a <details>?

@inkredible-raccoonbot did you figure it out? what was the problem?

No I didn't, but unfortunately I had no time to wait for a potential fix / long investigation so I simply compiled node on my server instead of installing it via nvm.

@inkredible-raccoonbot if you provide the output I'm asking for I might be able to have a fix out in hours; I'm not sure why you wouldn't be willing to give it a shot.

Because I am scaling up my application and hence I have to setup this server in a timely manner. Right now node has been installed already and I would need to uninstall it.

I know this is frustrating for a developer who has no chance to track the bug and I also really appreciate your offer to investigate the issue. I am very sorry for not being a help in this matter.

I have exactly the same issue here. I use Centos 7.6.
nvm intsall node hangs
nvm intsall some version hangs
nvm intsall -lts work fine
But its a bit sad to have an nvm that canonly install node lts.
Here is the output of set -x; nvm install node
It seem to be stuck on some cURL commande
out.txt

@ThibaultUrien and what happens when you run curl --fail --compressed -q -L -s https://iojs.org/dist/index.tab -o - directly?

It hang. It just stay unresponsive without any output until I send SIGINT.

That suggests it鈥檚 a problem with curl itself, or your network - if you add --verbose what do you get?

I get :
-bash-4.2$ curl --fail --compressed -q -L -s https://iojs.org/dist/index.tab -o - --verbose
* About to connect() to iojs.org port 443 (#0)
* Trying 2604:a880:400:d0::b2c:a001...

And that's all. I'm surprised that curl do not time out at some point.

I was having the same issue (CentOS 7.6) and manually updating curl to the latest version (7.65.3)seems to have resolved it.

With CentOS 7 you'll have to add the city-fan repo by creating a new file /etc/yum.repos.d/city-fan.repo and pasting in the following:

[CityFan]
name=City Fan Repo
baseurl=http://www.city-fan.org/ftp/contrib/yum-repo/rhel$releasever/$basearch/
enabled=1
gpgcheck=0

Then if you haven't already, install epel-release and update curl:

yum clean all
yum install epel-release
yum update

This fixed it for me on a fresh install of CentOS so hopefully you'll see get the same result.

I had this same issue, and since it's the first Google result, I figure I'd mention what my issue was.

The command mentioned above told me that my system was using IPv6 by default to pull the releases, as it simply hung at an IPv6 address after running it. That command again is:

curl --fail --compressed -q -L -s https://iojs.org/dist/index.tab -o - --verbose

I do not have this issue on my other servers, but in this particular situation, I was attempting to install nvm within an internal network at my place of work. And seeing as I am unable to personally troubleshoot and configure IPv6, I had no other choice than to simply disable it on my CentOS 7 system. This fixed my issue, though I hate to resort to disabling IPv6.

To test if this may also be your issue, run the same command as above, but simply append --ipv4 on it:

curl --fail --compressed -q -L -s https://iojs.org/dist/index.tab -o - --verbose --ipv4

If it successfully pulls down the releases, I would suggest either troubleshooting your IPv6 configurations, or if you're in a situation like mine where you have no control over them, simply disable IPv6 on your server.

Hope this helps anyone else who runs into this.

update2020: It seems to be something with ipv6, a 'sysctl -w net.ipv6.conf.all.disable_ipv6=1' temporarily disables ipv6 and 'nvm install node' works fine

Was this page helpful?
0 / 5 - 0 ratings