I am trying to setup a SharePoint 2016 on-premise site with react using Yeoman generator : @microsoft/generator-sharepoint (V1.7.1).
I followed the instructions from microsoft docs only. I had referred few other resources as well for changing package modules and getting a working solution. Some of the resources are:
- SharePoint Framework v1.7.0 - What's in the latest update of SPFx
- some other resources which suggested to use:
npm outdated
command to check and confirm that required versions are installed.
Steps I followed :
- Downgraded my Node from 10.x to 8.15.1 .Reason : 9.x or 10.x Node versions are currently not supported with SharePoint Framework development.
- Install Yeoman and gulp ==> npm install -g yo gulp
- Install Yeoman SharePoint generator ==> npm install -g @microsoft/generator-sharepoint .
- Creating a new web part project ==> yo @microsoft/sharepoint --skip-install
After solution got created,updated package.json to following :
{ "name": "sample", "version": "0.0.1", "private": true, "engines": { "node": ">=0.10.0" }, "scripts": { "build": "gulp bundle", "clean": "gulp clean", "test": "gulp test" }, "dependencies": { "react": "16.3.2", "react-dom": "16.3.2", "@types/react": "16.4.2", "@types/react-dom": "16.0.5", "@types/react-addons-shallow-compare": "0.14.17", "@types/react-addons-update": "0.14.14", "@types/react-addons-test-utils": "0.14.15", "@microsoft/sp-core-library": "~1.7.1", "@microsoft/sp-webpart-base": "~1.7.1", "@microsoft/sp-lodash-subset": "~1.7.1", "@microsoft/sp-office-ui-fabric-core": "~1.7.1", "@types/webpack-env": "1.13.1", "@types/es6-promise": "0.0.33" }, "resolutions": { "@types/react": "16.4.2" }, "devDependencies": { "@microsoft/sp-build-web": "~1.7.1", "@microsoft/sp-module-interfaces": "~1.7.1", "@microsoft/sp-webpart-workbench": "~1.7.1", "gulp": "~3.9.1", "@types/chai": "3.4.34", "@types/mocha": "2.2.38", "ajv": "~5.2.2" } }
- Then run ==> npm i --save ==> Ignored warnings generated along with it.
- After installation, run ==> gulp trust-dev-cert
- Finally, run ==> gulp serve.
After following these sequence of steps, SPFX site got loaded in the localhost at port 4321. But in every 5 to 10 seconds it is getting reloaded continuously in chrome and IE as well.
Need help in fixing this.
Hope I haven't missed anything so far for the SPFX Project setup.