nvm: NVM install node freezes

  • 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.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 17 (6 by maintainers)

Most upvoted comments

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

Had the same issue. I did let it run for a while (5 minutes?) while it seemed to be stuck and it eventually installed.

In my case I was running it in wsl2 ubuntu

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.

@romanpastu try to disable ipv6 on windows. That works on Linux.

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.