Nicer failure message when trying to install an invalid version. Fixes #285.

master
Jordan Harband 2014-05-04 00:59:08 -07:00
parent 5aa78f21cf
commit f00d688c87
1 changed files with 5 additions and 0 deletions

5
nvm.sh
View File

@ -308,6 +308,11 @@ nvm() {
[ -d "$NVM_DIR/$VERSION" ] && echo "$VERSION is already installed." && return
if [ "$VERSION" = "N/A" ]; then
echo "Version '$VERSION' not found - try \`nvm ls-remote\` to browse available versions."
return 3
fi
# skip binary install if no binary option specified.
if [ $nobinary -ne 1 ]; then
# shortcut - try the binary if possible.