【问题标题】:Error - [trust-cert] TypeError: Cannot read property 'toString' of null错误 - [trust-cert] TypeError:无法读取 null 的属性“toString”
【发布时间】:2020-11-12 07:41:28
【问题描述】:

我正在构建我的第一个 SharePoint 客户端 Web 部件。我使用了gulp trust-dev-cert,输出带有 2 个错误。如何解决?

C:\sharepoint>gulp trust-dev-cert
Build target: DEBUG
[12:50:19] Using gulpfile C:\sharepoint\gulpfile.js
[12:50:19] Starting gulp
[12:50:19] Starting 'trust-dev-cert'...
[12:50:19] Starting subtask 'configure-sp-build-rig'...
[12:50:19] Finished subtask 'configure-sp-build-rig' after 5.6 ms
[12:50:19] Starting subtask 'trust-cert'...
[12:50:22] Error - [trust-cert] TypeError: Cannot read property 'toString' of null
[12:50:22] Error - 'trust-cert' sub task errored after 2.59 s
 Cannot read property 'toString' of null
[12:50:22] 'trust-dev-cert' errored after 2.93 s
[12:50:22]
[12:50:23] ==================[ Finished ]==================
Error - [trust-cert] TypeError: Cannot read property 'toString' of null
Error - 'trust-cert' sub task errored after 2.59 s
 Cannot read property 'toString' of null
[12:50:23] Project sharepoint version:0.0.1
[12:50:23] Build tools version:3.12.1
[12:50:23] Node version:v10.23.0
[12:50:23] Total duration:8.05 s
[12:50:23] Task errors:2

This is the content in the folder

【问题讨论】:

    标签: sharepoint gulp sharepoint-online yo


    【解决方案1】:

    您需要在特定的 SPFX 解决方案文件夹中运行 gulp trust-dev-cert,确保文件夹路径“C:\sharepoint”有效:

    【讨论】:

    • 我已将所有内容安装在 sharepoint 文件夹本身中。那是我创建的唯一解决方案文件夹。我应该在目录中运行 gulp(它包含 node_modules、src、config 等)还是目录的任何特定文件夹?
    • 您使用的是哪个节点版本?如果是 Node.js v8,那么可能是 bug:github.com/SharePoint/sp-dev-docs/issues/4987 尝试改用 Node.js v10.x
    • 我正在使用 Node.js v10.x。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-01-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-07
    • 1970-01-01
    • 2022-01-12
    相关资源
    最近更新 更多