I’ll introduce how to update the version of nvm itself, the Node.js version management tool.
Prerequisites
Check nvm version
$ nvm --version
0.34.0
Check git version
$ git --version
git version 2.23.0
Update nvm version
Shell script to update nvm version
You can update the nvm version by simply running the following shell script in Terminal:
NVM_DIR=~/.nvm
(
cd "$NVM_DIR"
git fetch --tags origin
git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)`
) && \\. "$NVM_DIR/nvm.sh"
Check nvm version after update
$ nvm --version
0.35.0
That’s all from the Gemba.