What is the officially supported Node version(s)?
What type of issue is this?
Question
What SharePoint development model, framework, SDK or API is this about?
💥 SharePoint Framework
Target SharePoint environment
SharePoint Online
What browser(s) / client(s) have you tested
- [ ] 💥 Internet Explorer
- [ ] 💥 Microsoft Edge
- [ ] 💥 Google Chrome
- [ ] 💥 FireFox
- [ ] 💥 Safari
- [ ] mobile (iOS/iPadOS)
- [ ] mobile (Android)
- [X] not applicable
- [ ] other (enter in the "Additional environment details" area below)
Additional environment details
No response
Issue description
On this documentation page it says:
The SharePoint Framework v1.12.1 is supported on the following Node.js versions:
- Node.js v10.13.0+ (Dubnium)
- Node.js v12.13.0+ (Erbium)
- Node.js v14.15.0+ (Fermium)
But in this issue (september 2020), someone said to downgrade Node v12 to v10:
your node version is 12 which is still not supported by spfx. Use nvm to install node version 10 and use the version 10.
Also in this issue:
For what its worth, it sounds like there is a compatibility issue with your version of Gulp/Node and this solution. Please be aware you need to use Node 8 or 10 with this solution and gulp v3
I have the same issue (and node version) that the guy who posted there (when following the Microsoft documentation https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/build-a-hello-world-web-part), so I'm now confused about which version of node is officially supported? It would be nice to have it displayed on https://github.com/SharePoint/sp-dev-docs – maybe it's a Gulp issue, but again it would be nice to have some info…
Thanks
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
This depends on the SharePoint Framework version. The latest SharePoint Framework v1.12.1 has been released a few days ago, and it adds support for Node.js v12.13.x & v14.15.x. The official article is here: https://docs.microsoft.com/en-us/sharepoint/dev/spfx/release-1.12.1
In the previous version of SharePoint Framwork, it doesnot support node js v12. You could refer to this article : SPFx Compatibility Matrix
These issues you mentioned, the developers were using previous version of SharePoint Framwork, which only support node v8 or v10.
So, if you have installed the lastest SharePoint Framework version v1.12.1, you can use node v12 and v14.
Michael Han Microsoft SharePoint Community Support
Thanks, Michael.
I just cloned the repo from https://github.com/pnp/sp-dev-fx-webparts/ and the version of SPFx modules are 1.11.0 in package.json. So I changed all 1.11.0 to 1.12.1 as shown in my package.json:
{
"name": "js-display-list",
"version": "2.0.0",
"private": true,
"engines": {
"node": ">=0.10.0"
},
"main": "lib/index.js",
"dependencies": {
"@microsoft/sp-core-library": "1.12.1",
"@microsoft/sp-office-ui-fabric-core": "^1.12.1",
"@microsoft/sp-property-pane": "1.12.1",
"@microsoft/sp-webpart-base": "1.12.1",
"@types/es6-collections": "^0.5.32"
},
"devDependencies": {
"@microsoft/rush-stack-compiler-3.2": "^0.10.9",
"@microsoft/rush-stack-compiler-3.3": "0.3.5",
"@microsoft/sp-build-web": "1.12.1",
"@microsoft/sp-module-interfaces": "1.12.1",
"@microsoft/sp-tslint-rules": "1.12.1",
"@microsoft/sp-webpart-workbench": "1.12.1",
"@types/chai": "3.4.34",
"@types/es6-promise": "0.0.33",
"@types/mocha": "2.2.38",
"@types/webpack-env": "1.13.1",
"ajv": "5.2.2",
"es6-collections": "^0.5.6",
"gulp": "~3.9.1",
"tslint-microsoft-contrib": "5.0.0"
},
"scripts": {
"build": "gulp bundle",
"clean": "gulp clean",
"test": "gulp test"
}
}
Then I ran npm install. I have Gulp v3.9.1, and Node v12.16.1 and I keep getting the same error with gulp serve:
ReferenceError: primordials is not defined
By checking the release page I found I should now use Gulp v4.0.2, so I installed it and the error is gone, but gulp serve (as indicated in the documentation) is not defined because it's now deprecated with v1.12.1 – finally I've been able to use gulp serve-deprecated to execute the example…
The samples need to be updated, as well as the documentation. Running an example should be quick and easy!
Thanks for your quick reply anyway!
@Aymkdn , Yes in an ideal world, all solutions and samples would be running the latest version. However, SPFx 1.12.1 was just released a couple days ago, and we have hundreds of samples. It's is inconceivable and unlikely we'd be able to update them all when it's released. Nor would that be a great idea until we know that the latest version is stable to use. Generally speaking, the Microsoft docs will be more up to date than the samples as a result.
There are many samples in that repo that use much older version for compatibility reasons. It is up to the developer to make sure they check which version the samples are using and have the proper development environment set up to use them. Use the compatibility matrix to help guide you. https://docs.microsoft.com/en-us/sharepoint/dev/spfx/compatibility
For the SPFx 1.11 samples, You need to use Node 10, and you should be using Gulp 3.
Thanks. I hope this thread will help other developers :-) I'm closing it now.
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues