javascript - 打字环境安装不起作用

标签 javascript node.js typescript tsd

我正在尝试安装一些环境类型,但它不再在我的机器上运行。我最近升级了 Node ,所以不确定这是否导致了它。它似乎不再在 dt 位置查找。

这是我得到的错误:

~/w/r/c/src (master ⚡☡) typings search moment-timezone
Viewing 1 of 1

NAME            SOURCE HOMEPAGE                      DESCRIPTION VERSIONS UPDATED
moment-timezone dt     http://momentjs.com/timezone/             1        2016-03-29T22:03:48.000Z

~/w/r/c/src (master ⚡☡) typings i moment-timezone --ambient
typings ERR! message Unable to find "moment-timezone" ("npm") in the registry. Did you want to try searching another source? Also, if you want contribute these typings, please help us: https://github.com/typings/registry
typings ERR! caused by https://api.typings.org/entries/npm/moment-timezone/versions/latest responded with 404, expected it to equal 200

typings ERR! cwd /Users/pete/work/ruuby/calendar-sync/src
typings ERR! system Darwin 15.3.0
typings ERR! command "/usr/local/Cellar/node/6.1.0/bin/node" "/usr/local/bin/typings" "i" "moment-timezone" "--ambient"
typings ERR! node -v v6.1.0
typings ERR! typings -v 1.0.3

typings ERR! If you need help, you may report this error at:
typings ERR!   <https://github.com/typings/typings/issues>

最佳答案

答案在这里:https://github.com/typings/typings/releases/tag/v1.0.0

TLDR:--ambient 已更改为 --global

更新自下方评论

您还需要指定存储库,例如:

typings install dt~moment-timezone --global

关于javascript - 打字环境安装不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37275306/

相关文章:

javascript - IE 性能问题 - 慢

javascript - Threejs 围绕 Y 旋转相机

javascript - 在javascript中动态扩展一个类

javascript - Node 脚本永远不会结束

javascript - 在 NextJS 中使用轻量级图表时出现 SyntaxError

typescript - 使用 karma-jasmine 和 istanbul 的 Typescript 代码覆盖率

javascript - 在数字时钟中添加零

node.js - Coffeescript 和 node.js 混淆。需要实例化类?

typescript 阴影变量

javascript - 从 typescript 对象中查找具有填充值的属性名称