[New] nvm install: add --latest-npm option to automatically try to upgrade to the latest working version of npm.

- also add `nvm install-latest-npm` top-level command
This commit is contained in:
Jordan Harband
2017-06-11 14:15:04 -07:00
parent 28fe93cd15
commit cbdd41eee2
4 changed files with 196 additions and 1 deletions

View File

@@ -0,0 +1,12 @@
#!/bin/sh
set -ex
die () { echo "$@" ; exit 1; }
set +e # todo: fix
\. ../../nvm.sh
set -e
NVM_DEBUG=1 nvm install --latest-npm 4.2.2 \
| grep 'Attempting to upgrade to the latest working version of npm...' || die 'did not call through to nvm_install_latest_npm'