我试图弄清楚如何在 Angular CLI 环境中使用各种 3rd 方库。官方wiki 页面对于使用 moment.js lib 非常有用。但是,在尝试为库安装类型时遇到了麻烦(教程中的步骤 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
文件添加到项目文件夹中。在这种情况下,包含 3rd 方类型的最佳方式是什么?