At the time of writing, the LTS version 8.x of Node.js is needed to develop SharePoint Framework web parts and extensions. This is mentioned in Technet. However, the newest LTS version is 10.x.
That is the reason why I wanted two Node.js versions installed on the same Windows machine.
Node Version Manager (NVM) for Windows
Node Version Manager for Windows tackles this issue by installing each version of Node.js in a seperate folder. Then you will be able to switch versions by updating the NVM created symlinks (symbolic links; shortcuts) to the needed Node.js directory.
In preparation of installing NVM, uninstall your already installed Node.js version. Also delete the existing NPM location (e.g. “C:\Users<user>\AppData\Roaming\npm”).
To install NVM for Windows just follow this link and grab the newest release.
After installation, you can install both of the mentioned versions above by writing the following in the terminal:
nvm install 8.14.0
nvm install 10.14.1
Switching between versions (changing the symlinks) is as easy as this:
nvm use 8.14.0
node --version // should output 8.14.0
nvm use 10.14.1
node --version // should output 10.14.1
If you develop SharePoint Framework web parts and extensions you would hit “nvm use 8.14.0”. To continue working on another project, that uses a different Node.js version, just hit “nvm use 10.14.1”.
We saw that it is possible to manage multiple versions of Node.js on a Windows machine. This enables us to develop SharePoint Framework web parts and extensions without interupting our other projects that are dependant on another version of Node.js.