SharePoint Framework needs an older version of Node.js – Engineerer
33
post-template-default,single,single-post,postid-33,single-format-standard,wp-custom-logo,bridge-core-3.1.2,qode-page-transition-enabled,ajax_fade,page_not_loaded,,footer_responsive_adv,hide_top_bar_on_mobile_header,qode-content-sidebar-responsive,qode-theme-ver-30.1,qode-theme-bridge,qode_header_in_grid,elementor-default,elementor-template-full-width,elementor-kit-641,elementor-page-1064

SharePoint Framework needs an older version of Node.js

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.

I was using Node.js in other projects as well. For those I had no reason to use the LTS version 8.x. Instead I used the newest LTS version.

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.