gulp 服务将返回此错误“文件不存在:C:\src\webparts\helloWorld\HelloWorldWebPart.manifest.json”

问题描述 投票:0回答:3

当我运行以下命令时:-

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'

有什么建议吗?

谢谢

javascript node.js sharepoint gulp yo
3个回答
0
投票

检查文件路径的大小写。请注意 config.json 中使用的大小写与文件系统中实际使用的大小写。在 Windows 机器上可能不是问题,但也许自动化构建使用的是不同的操作系统,这才是问题?

例如,在您的具体示例中,引用的路径是: \helloWorld\HelloWorldWebPart.manifest.json

也许实际上是: \HelloWorld\HelloWorldWebPart.manifest.json


0
投票

我想您尝试遵循 SPFx Microsoft 教程,但由于某种原因,该文件未生成。我在 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"
    }
  }]
}

如果有效,请给我们反馈。


0
投票

我可以知道这个问题的解决方案吗:) 我现在面临同样的问题,

© www.soinside.com 2019 - 2024. All rights reserved.