Skip to content
Myr

[Fix] `latest-npm`: ensure npm 7 is not installed on node < 10

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 6110d31 · Browse files · 1 file+9 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

1 file+9 added−0 removed

  • other:+9 added−0 removed

1 file+9 added−0 removed

modified:nvm.sh+9 added
241 unmodified lines
242 NVM_IS_9_3_OR_ABOVE=1243 fi244 fi245246 local NVM_IS_10_OR_ABOVE247 NVM_IS_10_OR_ABOVE=0248 if [ $NVM_IS_9_3_OR_ABOVE -eq 1 ] && nvm_version_greater_than_or_equal_to "${NODE_VERSION}" 10.0.0; then249 NVM_IS_10_OR_ABOVE=1250 fi251252 if [ $NVM_IS_4_4_OR_BELOW -eq 1 ] || {253 [ $NVM_IS_5_OR_ABOVE -eq 1 ] && nvm_version_greater 5.10.0 "${NODE_VERSION}"; \254 }; then255 nvm_echo '* `npm` `v5.3.x` is the last version that works on `node` 4.x versions below v4.4, or 5.x versions below v5.10, due to `Buffer.alloc`'
9 unmodified lines
265 || { [ $NVM_IS_9_OR_ABOVE -eq 1 ] && [ $NVM_IS_9_3_OR_ABOVE -eq 0 ]; } \266 ; then267 nvm_echo '* `npm` `v6.9` is the last version that works on `node` `v6.0.x`, `v6.1.x`, `v9.0.x`, `v9.1.x`, or `v9.2.x`'268 $NVM_NPM_CMD install -g npm@6.9269 elif [ $NVM_IS_10_OR_ABOVE -eq 0 ]; then270 nvm_echo '* `npm` `v6.x` is the last version that works on `node` below `v10.0.0`'271 $NVM_NPM_CMD install -g npm@6272 else273 nvm_echo '* Installing latest `npm`; if this does not work on your node version, please report a bug!'274 $NVM_NPM_CMD install -g npm275 fi
3582 unmodified lines