DEV Community

Yuki Nagae
Yuki Nagae

Posted on

"asdf" multiple runtime version manager to install node.js

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
Enter fullscreen mode Exit fullscreen mode

Add node.js plugin for asdf:

asdf plugin-add nodejs
Enter fullscreen mode Exit fullscreen mode

Install node.js latest version and set it on a global context:

asdf install nodejs latest
asdf global nodejs
Enter fullscreen mode Exit fullscreen mode

You can specify a version instead of "latest":

asdf install nodejs 19.3.0
Enter fullscreen mode Exit fullscreen mode

Check node.js and npm versions (versions depend on your environment):

$ node -v
v19.3.0
$ npm -v
9.2.0
Enter fullscreen mode Exit fullscreen mode

That's all!

Top comments (0)