DEV Community

Yuki Nagae
Yuki Nagae

Posted on

7

"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!

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay