Operating system and version: Linux
nvm debug output:
nvm --version: v0.33.0
$SHELL: /bin/bash
$HOME: /Users/bjaspan
$NVM_DIR: '$HOME/.nvm'
$PREFIX: ''
$NPM_CONFIG_PREFIX: ''
nvm current: v7.4.0
which node: $NVM_DIR/versions/node/v7.4.0/bin/node
which iojs:
which npm: $NVM_DIR/versions/node/v7.4.0/bin/npm
npm config get prefix: $NVM_DIR/versions/node/v7.4.0
npm root -g: $NVM_DIR/versions/node/v7.4.0/lib/node_modules
nvm ls output: v6.9.5
-> v7.4.0
default -> node (-> v7.4.0)
node -> stable (-> v7.4.0) (default)
stable -> 7.4 (-> v7.4.0) (default)
iojs -> N/A (default)
lts/* -> lts/boron (-> v6.9.5)
lts/argon -> v4.7.3 (-> N/A)
lts/boron -> v6.9.5
nvm? (e.g. install script in readme, homebrew): Unsure
nvm install lts/boron, after running "set -e" in the shell.
nvm install displayed nvm_ensure_default_set: a version is required and exited with non-zero status.
The lts/boron version should have been installed and nvm install should have exited with zero status.
.bashrc, .bash_profile, .zshrc, etc) that modifies the PATH?No.
I ran "nvm install lts/boron" in a Bash script with set -e and set -x. I traced through the "nvm install lts/boron" output, following along in the source of the nvm shell function. I discovered a bug in the nvm install command.
To reproduce, uninstall lts/boron, then install it with set -e enabled, and check that the exit status is 1, whereas if you uninstall it and install it again with set -e disabled, the exit status is zero (the error message is displayed in either case).
The workaround is to use nvm install v6.9.5, which is the version lts/boron actually maps to. This avoids the bug in nvm install, so provided_version remains set, and nvm_ensure_default_set succeeds, and the script exits with status 0 even with set -e.
Just to clarify, if you don't have set -e set, everything works with nvm install lts/boron?
Thanks, I want nvm to work with set -e set, but there are still a number of places where it doesn't. I'll look into it.
It works, but it outputs the error message nvm_ensure_default_set: a version is required before succeeding.
Most helpful comment
It works, but it outputs the error message
nvm_ensure_default_set: a version is requiredbefore succeeding.