DEV Community

Cubite
Cubite

Posted on

2 2

How to install multiple node versions on the same machine

Our headless CMS, Strapi requires node version <= 14.x.x and we had node version 15 installed in our development machine. So that brought a question to my mind, is there a way like python venv for node to install different versions in the same machine. After doing a quick investigation, I found nvm node version manager that lets you have different versions of node on the same machine and switching between them.

How to install

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash

Enter fullscreen mode Exit fullscreen mode

or

wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash

Enter fullscreen mode Exit fullscreen mode

To verify installation run nvm --version

List and Install node versions

To list available versions, you can run

nvm ls-remote
Enter fullscreen mode Exit fullscreen mode

To install specific version you can use nvm install VERSION for example

nvm install 12.18.4
Enter fullscreen mode Exit fullscreen mode

Switch between different versions

You can use nvm use to switch to a specific version. For example

nvm use 12.18.4
Enter fullscreen mode Exit fullscreen mode

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