fix: "Unable to obtain node version." in git bash windows

$ nvm install-latest-npm
Attempting to upgrade to the latest working version of npm...
Unable to obtain node version.
This commit is contained in:
svihpinc 2024-09-02 18:14:52 +05:30 committed by GitHub
parent 9a28dbd394
commit 01bbb784a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

2
nvm.sh
View File

@ -1273,7 +1273,7 @@ nvm_ls_current() {
nvm_add_iojs_prefix "$(iojs --version 2>/dev/null)"
elif nvm_tree_contains_path "${NVM_DIR}" "${NVM_LS_CURRENT_NODE_PATH}"; then
local VERSION
VERSION="$(node --version 2>/dev/null)"
VERSION="$(command node --version 2>/dev/null)"
if [ "${VERSION}" = "v0.6.21-pre" ]; then
nvm_echo 'v0.6.21'
else