【问题标题】:gulp serve will return this error "File does not exist: C:\src\webparts\helloWorld\HelloWorldWebPart.manifest.json"gulp serve 将返回此错误“文件不存在:C:\src\webparts\helloWorld\HelloWorldWebPart.manifest.json”
【发布时间】:2021-06-05 18:28:21
【问题描述】:

当我运行以下命令时:-

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'

有什么建议吗?

谢谢

【问题讨论】:

  • 你有文件HelloWorldWebPart.manifest.json吗?
  • @EthanSnow 不,它不在那里......你能建议吗?
  • @EthanSnow 我如何生成这个文件?

标签: javascript node.js sharepoint gulp yo


【解决方案1】:

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

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

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

【讨论】:

    【解决方案2】:

    我想您尝试按照 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"
        }
      }]
    }
    

    如果可行,请给我们反馈。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-09-23
      • 1970-01-01
      • 2014-04-03
      • 1970-01-01
      • 2021-12-25
      • 1970-01-01
      • 2020-03-03
      • 1970-01-01
      相关资源
      最近更新 更多