【问题标题】:PptxGenJS - Issue with NPM declaration of filePptxGenJS - 文件的 NPM 声明问题
【发布时间】:2018-08-31 10:49:54
【问题描述】:

我正在尝试在 SharePoint 的 WebPart 中使用 PPTXGenJS,因此需要导入 npm 包。 不幸的是,我无法在我的程序中使用它,因为代码告诉我缺少声明文件。 npm install @types/pptxgenjs@latest 只是抛出一个错误,甚至附加一个新的 pptxgenjs.d.ts 文件声明模块不起作用。

你有什么想法吗?

谢谢!

【问题讨论】:

    标签: npm types package declaration pptxgenjs


    【解决方案1】:

    作者以旧方式(DefinitelyTyped)提供类型。这就是“npm install @types/pptxgenjs@latest”不起作用的原因。

    尝试“npm install pptxgenjs”,或将其添加到 package.json 文件中的依赖项中,如下所示:

    “依赖”:{ “pptxgenjs”:“^2.3.0” }

    这将安装依赖项,类型将在 dist/pptxgenjs 中可用

    【讨论】:

    • 谢谢!我以前试过这个,但不幸的是,用 npm install pptxgenjs 加载的代码不是最新的。我必须手动将 git-repo 中的代码发布到我的 index.d.ts 文件中。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-11-28
    • 1970-01-01
    • 2014-07-29
    • 1970-01-01
    • 1970-01-01
    • 2020-11-13
    相关资源
    最近更新 更多