Use and manage multiple Node.js versions on Windows 10

For a new project I needed to have Node 14 running on my Windows 10 machine, so installation was done quickly via downloading and running the setup file.

A short time later I wanted to write a new blog post here on kiko.io, which depends on the Node.js based static site generator Hexo … and ran into several problems.

First of all my hero image processing script (see Automatic Header Images in Hexo) returned an exception. The script uses hexo-fs and the problem is known quite some time, according to this Github issue. The guys recommend to downgrade to an older version of Node.js … :(

Ok … I needed a solution to install multiple Node.js versions and switch between them, depending on which project I want to work on … and there is one: nvm-windows by Corey Butler!

This Node.js Version Manager for Windows is working similar to the often mentioned n and nvm, which support Linux and Mac only. The latest release of nvm-windows can be downloaded here.

The setup is pretty straight forward and asks you at the very end, if the currently installed Node.js version should be managed by it. Confirmed…

There are just a few commands to know and to run in the command line:

List available Node.js versions

1
nvm list available

nvm install

Install needed Node.js version

1
nvm install <version>

nvm install

Switch to particular Node.js version

1
nvm use <version>

nvm use

List all installed Node.js versions

1
nvm ls

nvm ls

In case you have Node.js version dependend utilities installed globally, you need to run npm install -g after switch.

More Info

Webmentions

No Webmentions yet...

In case your blog software can't send Webmentions, you can use this form to submit me a mention of this article...


Comments

Related