Skip to content
Myr

[Fix] `nvm_install_latest_npm`: fix node version detection

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Toni Viemerö · committed by Jordan Harband · parent ffec9fe · Browse files · 1 file+7 added−7 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+7 added−7 removed

  • other:+7 added−7 removed

1 file+7 added−7 removed

modified:nvm.sh+7 added-7 removed
354 unmodified lines
355 NVM_IS_20_5_OR_ABOVE=0356 if [ $NVM_IS_19_OR_ABOVE -eq 1 ] && nvm_version_greater_than_or_equal_to "${NODE_VERSION}" 20.5.0; then357 NVM_IS_20_5_OR_ABOVE=1358 fi359 local NVM_IS_20_17_or_ABOVE360 NVM_IS_20_17_or_ABOVE=0361 if [ $NVM_IS_20_5_OR_ABOVE -eq 1 ] && nvm_version_greater 20.17.0 "${NODE_VERSION}"; then362 NVM_IS_20_17_or_ABOVE=1359 local NVM_IS_20_17_OR_ABOVE360 NVM_IS_20_17_OR_ABOVE=0361 if [ $NVM_IS_20_5_OR_ABOVE -eq 1 ] && nvm_version_greater_than_or_equal_to "${NODE_VERSION}" 20.17.0; then362 NVM_IS_20_17_OR_ABOVE=1363 fi364 local NVM_IS_21_OR_ABOVE365 NVM_IS_21_OR_ABOVE=0366 if [ $NVM_IS_20_17_or_ABOVE -eq 1 ] && nvm_version_greater 21.0.0 "${NODE_VERSION}"; then366 if [ $NVM_IS_20_17_OR_ABOVE -eq 1 ] && nvm_version_greater_than_or_equal_to "${NODE_VERSION}" 21.0.0; then367 NVM_IS_21_OR_ABOVE=1368 fi369 local NVM_IS_22_9_OR_ABOVE370 NVM_IS_22_9_OR_ABOVE=0371 if [ $NVM_IS_21_OR_ABOVE -eq 1 ] && nvm_version_greater 22.9.0 "${NODE_VERSION}"; then371 if [ $NVM_IS_21_OR_ABOVE -eq 1 ] && nvm_version_greater_than_or_equal_to "${NODE_VERSION}" 22.9.0; then372 NVM_IS_22_9_OR_ABOVE=1373 fi374375 if [ $NVM_IS_4_4_OR_BELOW -eq 1 ] || {
43 unmodified lines
419 # TODO: 10.8.3 can run on 16.20.2?? https://github.com/nodejs/Release/issues/884#issuecomment-2558077691420 nvm_echo '* `npm` `v9.x` is the last version that works on `node` `< v18.17`, `v19`, or `v20.0` - `v20.4`'421 $NVM_NPM_CMD install -g npm@9422 elif \423 [ $NVM_IS_20_17_or_ABOVE -eq 0 ] \423 [ $NVM_IS_20_17_OR_ABOVE -eq 0 ] \424 || { [ $NVM_IS_21_OR_ABOVE -eq 1 ] && [ $NVM_IS_22_9_OR_ABOVE -eq 0 ]; } \425 ; then426 nvm_echo '* `npm` `v10.x` is the last version that works on `node` `< v20.17`, `v21`, or `v22.0` - `v22.8`'427 $NVM_NPM_CMD install -g npm@10
4234 unmodified lines