Skip to content

Commit 8bdd38c

Browse files
[Fix] Handle 'N/A' version instead of asking to install it, fix #1304
1 parent fd33179 commit 8bdd38c

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
@@ -2627,6 +2627,10 @@ nvm() {
26272627
return 8
26282628
fi
26292629

2630+
if [ "${VERSION}" = 'N/A' ] && [ "$(NVM_VERSION_ONLY=true nvm_remote_version "${PROVIDED_VERSION}")" = 'N/A' ]; then
2631+
nvm_err "Version '$PROVIDED_VERSION' not found - try \`nvm ls-remote\` to browse available versions."
2632+
return 3
2633+
fi
26302634
# This nvm_ensure_version_installed call can be a performance bottleneck
26312635
# on shell startup. Perhaps we can optimize it away or make it faster.
26322636
if ! nvm_ensure_version_installed "${VERSION}"; then

0 commit comments

Comments
 (0)