Skip to content

Commit 94a72ae

Browse files
committed
[Fix] nvm use: improve help output with bare nvm use and no .nvmrc
Closes #1914.
1 parent 011810e commit 94a72ae

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

nvm.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2909,6 +2909,10 @@ nvm() {
29092909
VERSION="$(nvm_version "${PROVIDED_VERSION}")"
29102910
fi
29112911
unset NVM_RC_VERSION
2912+
if [ -z "${VERSION}" ]; then
2913+
nvm_err 'Please see `nvm --help` or https://github.com/nvm-sh/nvm#nvmrc for more information.'
2914+
return 127
2915+
fi
29122916
else
29132917
VERSION="$(nvm_match_version "${PROVIDED_VERSION}")"
29142918
fi

0 commit comments

Comments
 (0)