使用gulp,'package-solution'子任务打包SharePoint应用程序时出错

wpx232ag  于 2022-12-08  发布在  Gulp
关注(0)|答案(1)|浏览(152)

我在打包SharePoint应用程序时遇到问题。根据文档,我们需要运行:

npm install
gulp bundle --ship
gulp package-solution --ship

关于最后一条语句:gulp package-solution --ship我收到以下错误:
错误-“package-solution”子任务在42毫秒后出错无法读取未定义的“package-solution”的属性“name”在50毫秒后出错

pbossiut

pbossiut1#

此问题是文件package-solution.json中缺失的部分。
需要有一个developer截面,见下图:

{
    "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json",
    "solution": {
        "name": "my-sample-solution",
        "id": "fafafafa-1776-0911-bead-abbadabba123",
        "version": "2.0.0.0",
        "isDomainIsolated": false,
        "includeClientSideAssets": true,
        "developer": {
            "name": "your-company",
            "websiteUrl": "http://your-company.com",
            "mpnId": "",
            "termsOfUseUrl": "http://your-company.com/home/about#terms",
            "privacyUrl": "http://your-company.com/home/about#privacy"
         }
     },
     "paths": {
         "zippedPackage": "solution/my-sample-solution.spapp"
     }
}

在与此GitHub问题相关的线程中找到了解决方案:SharePoint repository issue #6144

相关问题