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.

2 Comments

Add Yours

Hi Daniel

Thanks for your feedback!
Indeed a very neat way on managing multiple node versions.

I tried the image from waldeck but had some issues with trusting the local dev certificate to chrome. Running the gulp task “gulp trust-dev-cert” inside the docker container didn’t bring the resolution as it did running the task on my host machine.

Do you have a hint on how to do it correctly?

Regards
Kai

Leave a Reply