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
nvm list available
Install needed Node.js version
nvm install <version>
Switch to particular Node.js version
nvm use <version>
List all installed Node.js versions
In case you have Node.js version dependend utilities installed globally, you need to run
npm install -g after switch.
- Github: coreybutler/nvm-windows
- Microsoft Docs: Set up your Node.js development environment directly on Windows
You can interact with this article (applause, criticism, whatever) by mention it in one of your posts, which will be shown here as a Webmention, or by leaving a good old comment with your GitHub account.
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...