无法通过环境DefinitelyTyped安装Google API的输入

时间:2016-03-16 10:05:35

标签: typescript

我尝试从DefinitelyTyped/google-apps-script为Google API安装TypeScript Fragment类型。我知道它可以在环境包中使用:

.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> 所以它试图访问错误的目录。

这可能是/工具的问题吗?

1 个答案:

答案 0 :(得分:1)

事实证明,我必须更新到已解决此问题的typings的最新版本。