【发布时间】:2016-10-22 18:25:18
【问题描述】:
我正在尝试弄清楚如何在 Angular CLI 环境中使用各种第 3 方库。官方wiki page 对使用 moment.js 库非常有用。但是,我在尝试为库安装 typings 时遇到了麻烦(教程中的步骤 1a):
typings install moment --save
typings WARN hastypings Typings for "moment" already exist in
"node_modules/moment/moment.d.ts". You should let TypeScript resolve
the packaged typings and uninstall the copy installed by Typings
typings ERR! message Unable to find "moment" ("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
我的设置供参考:
angular-cli: 1.0.0-beta.5
node: 4.4.4
os: darwin x64
typings: 1.0.5
虽然错误消息建议“卸载 Typings 安装的副本”,但似乎没有新的 .d.ts 文件添加到项目文件夹中。在这种情况下,包含第 3 方输入的最佳方式是什么?
【问题讨论】:
-
你的问题解决了吗?您使用的是哪个版本的 angular2?
标签: typescript angular angular-cli