asdf is a runtime version management tool. It is similar to other tools such as rbenv (for ruby), nvm (for node), goenv (for golang).
Those tools focus on one language runtime, on the other hand asdf covers most of those language runtimes. Using asdf, you don't have to install each runtime version manager tool one by one, just asdf is enough.
Install asdf via brew:
brew install asdf
Add node.js plugin for asdf:
asdf plugin-add nodejs
Install node.js latest version and set it on a global context:
asdf install nodejs latest
asdf global nodejs
You can specify a version instead of "latest":
asdf install nodejs 19.3.0
Check node.js and npm versions (versions depend on your environment):
$ node -v
v19.3.0
$ npm -v
9.2.0
That's all!
Top comments (0)