From f00d688c87873a9e3cffc1dbf54f63e0edd6e69b Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Sun, 4 May 2014 00:59:08 -0700 Subject: [PATCH] Nicer failure message when trying to install an invalid version. Fixes #285. --- nvm.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nvm.sh b/nvm.sh index 4ed0926..38d1f17 100644 --- a/nvm.sh +++ b/nvm.sh @@ -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.