Configure your SharePoint Framework development environment

Install Node.js

Node.js is available in two different releases: the long term support release (aka: LTS) is the most stable version that is recommended for most users while the current version contains the latest features. 

Before installing Node.js, you should verify that you haven’t installed it previously. Open a command prompt or terminal (depending on your developer platform) and execute the following command:

node -v

If a version number is returned, you already have Node.js. The version(s) of Node.js you may use depends on the environment(s) you’ll be targeting.

SharePoint Online always uses the latest version of the SharePoint Framework, but SharePoint 2016 and SharePoint 2019 only support the versions that match the server-side dependencies of the deployed packages.

SharePoint versionSupported SPFx versionSupported features
SharePoint OnlineAll versionsAll features
SharePoint Server Subscription Editionv1.4.1 or lowerSPFx client-side web parts in classic and modern pages, and extensions in modern pages.
SharePoint Server 2019v1.4.1 or lowerSPFx client-side web parts in classic and modern pages, and extensions in modern pages.
SharePoint 2016 Feature Pack 2v1.1SPFx client-side web parts hosted in classic SharePoint pages.

For more information about SharePoint Framework development with SharePoint 2016 Feature Pack 2 and SharePoint 2019, see:

SPFx development environment compatibility

As each new version of the SharePoint Framework is released, support for newer versions libraries is constantly added to ensure that the toolset remains up to date.

The following table lists SharePoint Framework and compatible versions of common tools and libraries:

SPFxNode.js (LTS)NPMTypeScriptReact
1.16.1v16.13+v5, v6, v7, v8v4.5v17.0.1
1.16.0v16.13+v5, v6, v7, v8v4.5v17.0.1
1.15.2v12, v14, v16v5, v6, v7, v8v4.5v16.13.1
1.15.0v12, v14, v16v5, v6, v7, v8v4.5v16.13.1
1.14.0v12, v14v5, v6v3.9v16.13.1
1.13.1v12, v14v5, v6v3.9v16.13.1
1.13.0v12, v14v5, v6v3.9v16.13.1
1.12.1v10, v12, v14v5, v6v3.7v16.9.0
1.12.0v12, v10v5, v6v3.7v16.9.0
1.11.0v10v5, v6v3.3v16.8.5
1.10.0v8, v10v5, v6v3.3v16.8.5
1.9.1v8, v10v5, v6v2.9v16.8.5
1.8.2v8, v10v5, v6v2.9v16.7.0
1.8.1v8v5, v6v2.7, v2.9, v3v16.7.0
1.8.0v8v5, v6v2.7, v2.9, v3v16.7.0
1.7.1v8v5, v6v2.4v16.3.2
1.7.0v8v5, v6v2.4v16.3.2
1.6.0v6, v8v3 (w/ Node.js 6),
v5 (w/ Node.js 8)
v2.4v15
1.5.1v6, v8v3 (w/ Node.js 6),
v5 (w/ Node.js 8)
v2.4v15
1.5.0v6, v8v3 (w/ Node.js 6),
v5 (w/ Node.js 8)
v2.4v15
1.4.1v6, v8v3, v4v2.4v15
1.4.0v6v3, v4v2.4v15
1.3.0v6v3, v4v2.4v15
1.1.0v6v3, v4v2.4v15
1.0.0v6v3v2.4v15

If you already have a version of Node.js that’s compatible with the environment(s) you’ll be targeting, then skip to the next section.

Open a browser and navigate to the Node.js Foundation site: https://www.nodejs.org. The current LTS version may not be compatible with the current version of the SharePoint Framework, so you’ll navigate further into the site to ensure you download the appropriate installer. Select Downloads from the top menu navigation then scroll to the bottom of the page and select Previous Releases. Download the appropriate installer or binary for the platform you’re using. Run the installer, accepting all the default options. This will install Node.js and npm Node Package Manager.

Install Yeoman

Yeoman is a scaffolding engine, which executes generators that prompt the user with questions. Based on the answers to these questions, Yeoman then creates the folders and files defined by the generator.

Open a command prompt / terminal window and execute the following command to install Yeoman globally with npm:

npm install –global yo

Install Gulp CLI

Gulp is a task runner utility. It’s similar to MSBuild, a tool used by .NET developers and Visual Studio to compile projects, package solutions, and start a debugging experience.

If you previously installed Gulp globally, you need to uninstall it before installing Gulp CLI

npm uninstall –global gulp

To install Gulp CLI, open a command prompt / terminal window and execute the following command:

npm install –global gulp-cli

Install the SharePoint Framework Yeoman generator

Microsoft has created a Yeoman generator for scaffolding SharePoint Framework projects.

To install the latest version of the SharePoint Framework Yeoman generator globally with npm, open a command prompt / terminal window and execute the following command:

npm install –global @microsoft/generator-sharepoint

To install a specific version of the SharePoint Framework Yeoman generator globally with npm, open a command prompt / terminal window and execute the following command:

npm install –global @microsoft/generator-sharepoint@[version number]

npm install –global @microsoft/generator-sharepoint@1.9.1

Final Check to list all that we have installed:

npm list -g –depth=0

Reference 1

Leave a comment