2

浏览器无法显示 GULP SERVE SharePoint Workbench

我正在尝试使用Visual Studio CODE(版本 1.22.2)创建一个 SharePoint 2016 Web 部件,我一直在努力让开发环境在 Windows 7 和 Windows Server 2012 R2 中工作(完全相同的设置在视窗 10)。现在,我专注于 Windows Server 2012 环境,因为我在那里有更多的控制权......

提供一些背景知识: * Windows 10 机器:我自己构建的个人机器,我是管理员,所有功能都按预期工作。* Windows Server 2012 R2:工作机器,我必须忍受我所拥有的。我是本地管理员,但无法安装任何东西...所有现有应用程序都是由使用预打包部署工具的管理员安装的。有一些(未知的)安全限制(可能是组策略)可能会导致问题。* Windows 7:工作机器,我必须忍受我所拥有的。我现在是本地管理员,但所有现有应用程序都是由其他人使用预打包的部署工具安装的……有一些(未知的)安全限制(可能是组策略)可能会导致问题。

  • 我不得不为让环境使用“ yo @microsoft/sharepoint ”命令而奋斗......
  • 然后我不得不战斗只是为了让 gulp 运行(它说 sp-build-web 没有安装,即使它是......)

现在我无法让浏览器真正到达 gulp 服务。-是的,我尝试了“$env: NODE_NO_HTTP2=1 ”命令。-是的,我还使用了“ gulp trust-dev-cert ”命令

Internet Explorer 11仅显示: 此页面无法显示 * 确保网址https://localhost:5432正确。* 使用您的搜索引擎查找页面。* 几分钟后刷新页面。

Chrome显示类似的错误。

我已经没有想法了。我在下面没有看到任何错误,我可以继续跟进...

有人可以帮忙吗?

我有NodeJS v9.4.0安装和以下 npm 包:PS C:\code\VSCode\amtdHeadlines_untethered> npm list -g --depth=0 C:\Users\UName\AppData\Roaming\npm +-- @microsoft/generator-sharepoint@1.4。 1 +-- @microsoft/sp-build-web@1.4.1 +-- @microsoft/sp-client-base@1.0.0 +-- @microsoft/sp-client-preview@1.4.1 +-- @ microsoft/sp-core-library@1.4.1 +-- @microsoft/sp-module-interfaces@1.4.1 +-- @microsoft/sp-page-context@1.4.1 +-- @microsoft/sp-webpart -base@1.4.1 +-- @microsoft/sp-webpart-workbench@1.4.1 +-- @types/chai@4.1.3 +-- @types/mocha@5.2.0 +-- ajv@6.4。 0 +-- ansi-regex@2.1.1 +-- 平衡匹配@1.0.0 +-- 大括号扩展@1.1.11 +-- 代码点@1.1.0 +-- 罗盘@0.1。 1 +-- concat-map@0.0.1 +-- 控制台控制字符串@1.1.0 +-- express@4.16.3 +-- 生成器-aspnet@0.3。3 +-- generator-code@1.1.30 +-- generator-hottowel@0.6.1 +-- generator-webapp@3.0.1 +-- graceful-fs@4.1.11 +-- grunt@1.0.2 +-- gulp@4.0.0 +-- 继承@2.0.3 +-- is-fullwidth-code-point@1.0.0 +-- minimatch@3.0.4 +-- minimist@0.0.8 +-- minipass @2.2.4 +-- mkdirp@0.5.1 +-- mocha@5.1.1 +-- ncu@0.2.1 +-- npm@6.0.0 +-- npm-check-updates@2.14.2 +- - number-is-nan@1.0.1 +-- office-ui-fabric-js@1.5.0 +-- office-ui-fabric-react@5.94.0 +-- once@1.4.0 +-- 反应@16.3.2 +-- react-addons-update@15.6.2 +-- react-dom@16.3.2 +-- request@2.85.0 +-- safe-buffer@5.1.2 +-- 字符串宽度@1.0.2 +-- strip-ansi@3.0.1 +-- wrappy@1.0.2 +-- yallist@3.0.2 +-- yarn@1.6.0 `-- yo@2.0.2

PS C:\code\VSCode\amtdHeadlines_untethered> gulp serve
Build target: DEBUG
[17:34:15] Using gulpfile C:\code\VSCode\amtdHeadlines_untethered\gulpfile.js
[17:34:15] Starting gulp
[17:34:15] Starting 'serve'...
[17:34:15] Starting subtask 'pre-copy'...
[17:34:15] Finished subtask 'pre-copy' after 8.26 ms
[17:34:15] Starting subtask 'copy-static-assets'...
[17:34:15] Starting subtask 'sass'...
[17:34:16] Finished subtask 'sass' after 904 ms
[17:34:16] Starting subtask 'tslint'...
[17:34:16] Starting subtask 'typescript'...
[17:34:16] [typescript] TypeScript version: 2.2.2
[17:34:16] Finished subtask 'copy-static-assets' after 939 ms
[17:34:18] Finished subtask 'tslint' after 1.45 s
[17:34:18] Finished subtask 'typescript' after 1.45 s
[17:34:18] Starting subtask 'ts-npm-lint'...
[17:34:18] Finished subtask 'ts-npm-lint' after 8.62 ms
[17:34:18] Starting subtask 'api-extractor'...
[17:34:18] Finished subtask 'api-extractor' after 1.33 ms
[17:34:18] Starting subtask 'post-copy'...
[17:34:18] Finished subtask 'post-copy' after 700 μs
[17:34:18] Starting subtask 'collectLocalizedResources'...
[17:34:18] Finished subtask 'collectLocalizedResources' after 5.07 ms
[17:34:18] Starting subtask 'configure-webpack'...
[17:34:18] Finished subtask 'configure-webpack' after 504 ms
[17:34:18] Starting subtask 'webpack'...
(node:6804) DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see https
://github.com/webpack/loader-utils/issues/56
parseQuery() will be replaced with getOptions() in the next major version of loader-utils.
[17:34:19] Finished subtask 'webpack' after 676 ms
[17:34:19] Starting subtask 'configure-webpack-external-bundling'...
[17:34:19] Finished subtask 'configure-webpack-external-bundling' after 1.14 ms
[17:34:19] Starting subtask 'copy-assets'...
[17:34:19] Finished subtask 'copy-assets' after 63 ms
[17:34:19] Starting subtask 'write-manifests'...
[17:34:19] Finished subtask 'write-manifests' after 407 ms
[17:34:19] Starting subtask 'serve'...

在端口 5432 上启动 api 服务器。正在注册 api: /getwebparts 正在注册 api: / 注册 api:/workbench [17:34:20] 483 毫秒后完成子任务“服务”[17:34:20] 4.61 秒后完成“服务”(节点:6804) 实验警告:http2 模块是一个实验性 API。[17:34:20] 服务器启动https://localhost:4321 [17:34:20] LiveReload 在端口 35729 上启动 [17:34:20]使用默认操作系统应用程序打开https://localhost:5432/workbench请求:[::1] '/workbench' [17:34:20] ==================[ 完成 ]=========== ======= [17:34:21] 项目 amtd-headlines-untethered 版本:0.0.1 [17:34:21] 构建工具版本:2.5.3 [17:34:21] 节点版本:v9 .4.0 [17:34:21] 总持续时间:7.79 秒

4

1 回答 1

3

释放端口 5432,因为它可能正被另一个进程使用。

或者使用不同的配置为应用程序提供服务。转到“config.serve.js”并将端口更改为您的首选端口,例如从“5432”更改为“8080”,如下所示:

{
 "$schema": "https://developer.microsoft.com/json-schemas/core- 
build/serve.schema.json",
"port": 4321,
"https": true,
"initialPage": "https://localhost:8080/workbench",
"api": {
   "port": 8080,
   "entryPath": "node_modules/@microsoft/sp-webpart-workbench/lib/api/"
  }
}
于 2018-10-16T12:51:51.230 回答