我有两个问题:
typings search electron
会返回相当多的结果。如何安装它们? typings install dt~github-electron --global --save
给了我一个错误:
尝试编译“github-electron”作为外部模块,但它 看起来像一个全球模块。您需要启用全局选项 继续。
答案 0 :(得分:4)
来源需要设置为 dt ,它似乎工作正常。
$ typings install github-electron --source dt --global
答案 1 :(得分:3)
对于那些使用TypeScript版本2.0 +的人,您可以使用npm通过执行以下行
来获取它npm install --save @types/electron
以下是打字稿文档的快速参考
http://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html
如果您使用低于2的打字稿版本,您可以使用其他人已经帮助过的打字
答案 2 :(得分:1)
我不得不使用不同的输入名称:
typings install electron/github-electron --source dt --save --global