nvm-sh / nvm

Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions
MIT License
79.09k stars 7.92k forks source link

nvm: install v6.7.0 failed! #1255

Open nbullen opened 7 years ago

nbullen commented 7 years ago

I am trying to install a non root instance of node on LINUX Redhat. I do not have sudo privileges. I am getting the following error when i try nvm install node :

-bash-3.2$ nvm install node
Checksums match! Using existing downloaded archive $NVM_DIR/.cache/bin/node-v6.7.0-linux-x64/node-v6.7.0-linux-x64.tar.xz
tar: invalid option -- J
Try `tar --help' or `tar --usage' for more information.
Binary download failed, trying source.
Checksums match! Using existing downloaded archive $NVM_DIR/.cache/src/node-v6.7.0/node-v6.7.0.tar.xz
tar: invalid option -- J
Try `tar --help' or `tar --usage' for more information.
nvm: install v6.7.0 failed!

nvm 0.32.0 tar (GNU tar) 1.15.1

ljharb commented 7 years ago

What does nvm debug print out?

nbullen commented 7 years ago
-bash-3.2$ nvm debug
nvm --version: v0.32.0
$SHELL: /bin/bash
$HOME: /home/nbullen
$NVM_DIR: '$HOME/.nvm'
$PREFIX: ''
$NPM_CONFIG_PREFIX: ''
nvm current: none
which node: which: no node in (~/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin)
which iojs: which: no iojs in (~/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin)
which npm: which: no npm in (~/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin)
npm config get prefix: -bash: npm: command not found
npm root -g: -bash: npm: command not found
ljharb commented 7 years ago

It looks like by default Red Hat tar doesn't support xz - http://www.linuxquestions.org/questions/linux-software-2/how-to-install-tar-xz-file-in-redhat-linux-4175443828/#post4861385 implies you can install xz-utils and fix the problem?

nbullen commented 7 years ago

Okay I was able to get node installed by running unxz then tar as explained here: Extract a tar.xz file on CentOS and RedHat

This is now my issue:

-bash-3.2$ node -v
v6.7.0
-bash-3.2$ nvm use node
N/A: version "N/A" is not yet installed.

You need to run "nvm install N/A" to install it before using it.
ljharb commented 7 years ago

What does nvm ls and echo $PATH and which node print out?

xmeltrut commented 7 years ago

Installing xz-utils does not resolve the issue on CentOS 5. @nbullen can you expand on how you manually did the unxz? It's not clear how that would work as part of the nvm install process.

xmeltrut commented 7 years ago

The error @nbullen describes occurs when you just manually copy the version into your .nvm directory.

Here is the nvm ls output:

[vagrant@localhost .nvm]$ nvm ls
->     v0.10.41
         v6.9.2
default -> v0.10.41
node -> stable (-> v6.9.2) (default)
stable -> 6.9 (-> v6.9.2) (default)
iojs -> N/A (default)
lts/* -> lts/boron (-> N/A)
lts/argon -> v4.7.0 (-> N/A)

And which node

~/.nvm/v0.10.41/bin/node