DEV Community

Cover image for Install/Use Any Version of Node.js with nvm (Node Version Manager)
Anh Dung
Anh Dung

Posted on

1

Install/Use Any Version of Node.js with nvm (Node Version Manager)

Managing multiple versions of Node.js can be frustrating if you don’t have a quick way to install the needed version, especially across different OS platforms.

Thankfully, nvm (Node Version Manager) supports Unix, MacOS, and WSL for managing Node.js versions efficiently.

Initially, I thought of writing a lot, but here has everything you need and more 😥😥

Image description

Run this command in the terminal:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
Enter fullscreen mode Exit fullscreen mode

Or

wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
Enter fullscreen mode Exit fullscreen mode

Then, run:

export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
Enter fullscreen mode Exit fullscreen mode

Done. Now, use nvm install node to install the latest version or nvm ls to view available Node.js versions.

Cover photo by Lautaro Andreani

Heroku

Deliver your unique apps, your own way.

Heroku tackles the toil — patching and upgrading, 24/7 ops and security, build systems, failovers, and more. Stay focused on building great data-driven applications.

Learn More

Top comments (0)

Tiugo image

Fast, Lean, and Fully Extensible

CKEditor 5 is built for developers who value flexibility and speed. Pick the features that matter, drop the ones that don’t and enjoy a high-performance WYSIWYG that fits into your workflow

Start now

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay