Skip to content
Myr

[Fix] `install-latest-npm`: npm v11 is out

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

authored by Jordan Harband · committed by Jordan Harband · parent dae1427 · Browse files · 2 files+27 added−0 removed
This commit

State

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

Diff stats

2 files+27 added−0 removed

  • other:+27 added−0 removed

2 files+27 added−0 removed

modified:.github/workflows/latest-npm.yml+5 added
modified:nvm.sh+22 added
352 unmodified lines
353 NVM_IS_20_5_OR_ABOVE=0354 if [ $NVM_IS_19_OR_ABOVE -eq 1 ] && nvm_version_greater_than_or_equal_to "${NODE_VERSION}" 20.5.0; then355 NVM_IS_20_5_OR_ABOVE=1356 fi357 local NVM_IS_20_17_or_ABOVE358 NVM_IS_20_17_or_ABOVE=0359 if [ $NVM_IS_20_5_OR_ABOVE -eq 1 ] && nvm_version_greater 20.17.0 "${NODE_VERSION}"; then360 NVM_IS_20_17_or_ABOVE=1361 fi362 local NVM_IS_21_OR_ABOVE363 NVM_IS_21_OR_ABOVE=0364 if [ $NVM_IS_20_17_or_ABOVE -eq 1 ] && nvm_version_greater 21.0.0 "${NODE_VERSION}"; then365 NVM_IS_21_OR_ABOVE=1366 fi367 local NVM_IS_22_9_OR_ABOVE368 NVM_IS_22_9_OR_ABOVE=0369 if [ $NVM_IS_21_OR_ABOVE -eq 1 ] && nvm_version_greater 22.9.0 "${NODE_VERSION}"; then370 NVM_IS_22_9_OR_ABOVE=1371 fi372373 if [ $NVM_IS_4_4_OR_BELOW -eq 1 ] || {374 [ $NVM_IS_5_OR_ABOVE -eq 1 ] && nvm_version_greater 5.10.0 "${NODE_VERSION}"; \375 }; then
37 unmodified lines
413 elif \414 [ $NVM_IS_18_17_OR_ABOVE -eq 0 ] \415 || { [ $NVM_IS_19_OR_ABOVE -eq 1 ] && [ $NVM_IS_20_5_OR_ABOVE -eq 0 ]; } \416 ; then417 # TODO: 10.8.3 can run on 16.20.2?? https://github.com/nodejs/Release/issues/884#issuecomment-2558077691418 nvm_echo '* `npm` `v9.x` is the last version that works on `node` `< v18.17`, `v19`, or `v20.0` - `v20.4`'419 $NVM_NPM_CMD install -g npm@9420 elif \421 [ $NVM_IS_20_17_or_ABOVE -eq 0 ] \422 || { [ $NVM_IS_21_OR_ABOVE -eq 1 ] && [ $NVM_IS_22_9_OR_ABOVE -eq 0 ]; } \423 ; then424 nvm_echo '* `npm` `v10.x` is the last version that works on `node` `< v20.17`, `v21`, or `v22.0` - `v22.8`'425 $NVM_NPM_CMD install -g npm@10426 else427 nvm_echo '* Installing latest `npm`; if this does not work on your node version, please report a bug!'428 $NVM_NPM_CMD install -g npm429 fi
4228 unmodified lines