gulp serve将返回此错误“文件不存在:网址:\src\网页部件\您好世界\您好世界网页部件.清单. json”

vtwuwzda  于 2022-12-16  发布在  Gulp
关注(0)|答案(2)|浏览(191)

当我运行以下命令时:-

C:\helloworld-webpart>gulp serve

我会得到这个错误:-

[21:22:19] Error - 'configure-webpack' sub task errored after 289 ms
 File does not exist: C:\src\webparts\helloWorld\HelloWorldWebPart.manifest.json
File does not exist: C:\src\webparts\helloWorld\HelloWorldWebPart.manifest.json
ENOENT: no such file or directory, open 'C:\src\webparts\helloWorld\HelloWorldWebPart.manifest.json'

有什么建议吗?
谢啦,谢啦

cbeh67ev

cbeh67ev1#

检查文件路径的大小写。注意config.json中使用的大小写与文件系统中实际使用的大小写。在Windows机器上可能不是问题,但也许自动构建使用的是不同的操作系统,这是一个问题?
例如,在您的特定示例中,引用的路径为:\helloWorld\HelloWorldWebPart.manifest.json
也许它实际上是:\HelloWorld\HelloWorldWebPart.manifest.json

qyswt5oh

qyswt5oh2#

我想你尝试以下SPFx微软教程,并且,由于某种原因,这个文件没有生成。我在VSCode中生成一个同名的SPFx,并将复制文件文本结构为您生成这个,如下所示:

{
  "$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-web-part-manifest.schema.json",
  "id": "d0074c68-ef7e-4aba-9021-12b57f84aa4d",
  "alias": "HelloWorldWebPart",
  "componentType": "WebPart",

  // The "*" signifies that the version should be taken from the package.json
  "version": "*",
  "manifestVersion": 2,

  // If true, the component can only be installed on sites where Custom Script is allowed.
  // Components that allow authors to embed arbitrary script code should set this to true.
  // https://support.office.com/en-us/article/Turn-scripting-capabilities-on-or-off-1f2c515f-5d7e-448a-9fd7-835da935584f
  "requiresCustomScript": false,
  "supportedHosts": ["SharePointWebPart"],

  "preconfiguredEntries": [{
    "groupId": "5c03119e-3074-46fd-976b-c60198311f70", // Other
    "group": { "default": "Other" },
    "title": { "default": "HelloWorld" },
    "description": { "default": "HelloWorld description" },
    "officeFabricIconFontName": "Page",
    "properties": {
      "description": "HelloWorld"
    }
  }]
}

请给予我们反馈,如果它的作品。

相关问题