[Fix] `nvm install-latest-npm`: npm v6.14.18 can not be installed from npm < v4.4.4

Jordan Harband 2022-12-21 14:28:15 -08:00
parent abe5e30a9d
commit ac357c59ef
No known key found for this signature in database
GPG Key ID: 9F6A681E35EF8B56
1 changed files with 4 additions and 0 deletions

4
nvm.sh
View File

@ -332,6 +332,10 @@ nvm_install_latest_npm() {
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`' 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`'
$NVM_NPM_CMD install -g npm@6.9 $NVM_NPM_CMD install -g npm@6.9
elif [ $NVM_IS_10_OR_ABOVE -eq 0 ]; then elif [ $NVM_IS_10_OR_ABOVE -eq 0 ]; then
if nvm_version_greater 4.4.4 "${NPM_VERSION}"; then
nvm_echo '* `npm` `v4.4.4` or later is required to install npm v6.14.18'
$NVM_NPM_CMD install -g npm@4
fi
nvm_echo '* `npm` `v6.x` is the last version that works on `node` below `v10.0.0`' nvm_echo '* `npm` `v6.x` is the last version that works on `node` below `v10.0.0`'
$NVM_NPM_CMD install -g npm@6 $NVM_NPM_CMD install -g npm@6
elif \ elif \