Typescript 无法通过ambient DefinitelyTyped为Google API安装打字
我正在尝试从安装Google API的TypeScriptTypescript 无法通过ambient DefinitelyTyped为Google API安装打字,typescript,Typescript,我正在尝试从安装Google API的TypeScript.d.ts打字。我知道它在环境软件包中可用: $ typings search --ambient google Showing 20 of 39 results... NAME SOURCE HOMEPAGE DESCRIPTION UPD
.d.ts
打字。我知道它在环境软件包中可用:
$ typings search --ambient google
Showing 20 of 39 results...
NAME SOURCE HOMEPAGE DESCRIPTION UPDATED VERSIONS
angular-google-analytics dt https://github.com/revolunet/angular-google-analytics 2015-11-19T15:50:48.000Z 2
angular-google-analytics/angular-google-analytics-service dt https://github.com/revolunet/angular-google-analytics 2016-02-15T16:20:30.000Z 3
google-apps-script/google-apps-script.base dt https://developers.google.com/apps-script/ 2015-11-12T02:10:55.000Z 2
google-apps-script/google-apps-script.cache dt https://developers.google.com/apps-script/ 2015-11-12T02:10:55.000Z 2
google-apps-script/google-apps-script.calendar dt https://developers.google.com/apps-script/ 2015-11-12T02:10:55.000Z 2
google-apps-script/google-apps-script.charts dt https://developers.google.com/apps-script/ 2015-11-12T02:10:55.000Z 2
google-apps-script/google-apps-script.contacts dt https://developers.google.com/apps-script/ 2015-11-12T02:10:55.000Z 2
google-apps-script/google-apps-script.content dt https://developers.google.com/apps-script/ 2015-11-12T02:10:55.000Z 2
google-apps-script/google-apps-script.document dt https://developers.google.com/apps-script/ 2015-11-12T02:10:55.000Z 2
google-apps-script/google-apps-script.drive dt https://developers.google.com/apps-script/ 2015-11-12T02:10:55.000Z 2
google-apps-script/google-apps-script.forms dt https://developers.google.com/apps-script/ 2015-11-12T02:10:55.000Z 2
google-apps-script/google-apps-script.gmail dt https://developers.google.com/apps-script/ 2015-11-12T02:10:55.000Z 2
google-apps-script/google-apps-script.groups dt https://developers.google.com/apps-script/ 2015-11-12T02:10:55.000Z 2
google-apps-script/google-apps-script.html dt https://developers.google.com/apps-script/ 2015-11-12T02:10:55.000Z 2
google-apps-script/google-apps-script.jdbc dt https://developers.google.com/apps-script/ 2015-11-12T02:10:55.000Z 2
google-apps-script/google-apps-script.language dt https://developers.google.com/apps-script/ 2015-11-12T02:10:55.000Z 2
google-apps-script/google-apps-script.lock dt https://developers.google.com/apps-script/ 2015-11-12T02:10:55.000Z 2
google-apps-script/google-apps-script.mail dt https://developers.google.com/apps-script/ 2015-11-12T02:10:55.000Z 2
google-apps-script/google-apps-script.maps dt https://developers.google.com/apps-script/ 2015-11-12T02:10:55.000Z 2
google-apps-script/google-apps-script.optimization dt https://developers.google.com/apps-script/ 2015-11-12T02:10:55.000Z 2
但我无法安装以下任何一个:
$ typings i --ambient "google-apps-script/google-apps-script.maps"
它抛出一个错误:
? Found google-apps-script/google-apps-script.maps typings for DefinitelyTyped. Continue? Yes
Installing google-apps-script/google-apps-script.maps@~0.0.0 (DefinitelyTyped)...
typings ERR! message ENOENT: no such file or directory, open '/project/path/typings/main/ambient/google-apps-script/google-apps-script.maps/google-apps-script/google-apps-script.maps.d.ts'
typings ERR! cwd /project/path
typings ERR! system Darwin 15.3.0
typings ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/typings/dist/bin/typings-install.js" "--ambient" "google-apps-script/google-apps-script.maps"
typings ERR! node -v v4.2.2
typings ERR! typings -v 0.6.8
typings ERR! code ENOENT
typings ERR! If you need help, you may report this error at:
typings ERR! <https://github.com/typings/typings/issues>
?找到定义类型的google apps脚本/google-apps-script.maps键入。继续?对
正在安装google应用程序脚本/google应用程序脚本.maps@~0.0.0(定义类型)。。。
打字错误!message enoint:没有这样的文件或目录,打开“/project/path/typings/main/ambient/google apps script/google apps script.maps/google apps script/google apps script.maps.d.ts”
打字错误!cwd/项目/路径
打字错误!达尔文系统15.3.0
打字错误!命令“/usr/local/bin/node”“/usr/local/lib/node_modules/typings/dist/bin/typings install.js”“--ambient”“谷歌应用脚本/google应用脚本.maps”
打字错误!节点-v4.2.2
打字错误!打字-v 0.6.8
打字错误!代码eNONT
打字错误!如果需要帮助,您可以在以下位置报告此错误:
打字错误!
它显然能够找到包,但它似乎变得混乱,因为包的名称包含/
,所以它试图访问错误的目录
这可能是
打字工具的问题吗?事实证明,我刚刚更新了打字的最新版本,该版本已经解决了此问题。我复制了您的示例,它对我有效。我正在Windows 7上使用打字版本0.7.9。我已更新到最新的typings@0.7.9
你说得对,它现在可以工作了。我想这个问题已经在最近的一个版本中解决了。谢谢你,我挠头了一个小时。使用V7.12它不会安装打字,除非我删除打字文件夹并运行typings install