我正在尝试使用Yeoman生成器设置SharePoint 2016内部部署站点:@ microsoft / generator-sharepoint(V1.7.1)。
我只遵循microsoft docs的指示。我还提到了一些其他资源,用于更改包模块和获得可行的解决方案。一些资源是:
npm outdated
命令检查并确认已安装所需的版本。我遵循的步骤:
{
"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"
}
}
按照这些步骤执行后,SPFX站点在4321端口加载到localhost中。但是每隔5到10秒,它就会在chrome和IE中连续重载。
需要帮助来解决这个问题。
希望我到目前为止没有错过任何SPFX项目设置。
如果我正确理解您的问题,您正尝试在On Premise SharePoint 2016服务器场上使用React 16运行SPFx 1.7.1?这不行。 SharePoint 2016没有可用的laatste SPFx。您需要降级项目以匹配SharePoint附带的SPFx版本:
SharePoint 2016 Feature Pack 2支持在使用SharePoint Framework v1.1.0构建的经典SharePoint页面上托管的SharePoint Framework客户端Web部件。这意味着,当您定位SharePoint 2016平台时,由于服务器端版本依赖性,您需要使用SharePoint Framework v1.1.0。
https://docs.microsoft.com/en-us/sharepoint/dev/spfx/sharepoint-2016-support
SharePoint 2019内部部署目前随SPFx 1.4.1一起提供。我找不到这个atm的文档链接,但微软人员在社区调用中已经提到过。