Angular 卸载全局键入不允许我重新安装

Angular 卸载全局键入不允许我重新安装,angular,typescript,ionic2,Angular,Typescript,Ionic2,我已经使用typings install dt~moment--save--global安装了即时全局打字 运行typings list可以得到: ├── lodash@4.0.0 ├── es6-shim (global) └── moment (global) ├── lodash@4.0.0 └── es6-shim (global) 此后,我决定使用typings uninstall moment--global卸载它 运行typings list可以得到: ├── lodash@4

我已经使用
typings install dt~moment--save--global安装了即时全局打字

运行
typings list
可以得到:

├── lodash@4.0.0
├── es6-shim (global)
└── moment (global)
├── lodash@4.0.0
└── es6-shim (global)
此后,我决定使用
typings uninstall moment--global卸载它

运行
typings list
可以得到:

├── lodash@4.0.0
├── es6-shim (global)
└── moment (global)
├── lodash@4.0.0
└── es6-shim (global)
现在,我使用
typings install dt~moment在当前目录中安装--save
并得到以下错误:

打字错误!消息试图将“矩”编译为外部模块,但它看起来像一个全局模块。您需要启用全局选项才能继续。

究竟为什么会发生这种情况,我以前也尝试过清除缓存,但没有帮助

node v5
npm v3.3.9
tsc v1.8.10
编辑:
如果升级到typescript 2.0,则可以使用npm安装打字

npm install @types/moment


也许这会有帮助。

我不想在全局范围内安装它,我想在全局范围内卸载它,然后在局部范围内安装。我认为你做不到。我可能错了,但似乎moment只能安装为global。找到关于何时安装全局或本地的定义:“如果模块定义在顶层有导入或导出声明,则将其视为“外部”。其他所有内容都可以视为“全局”。“Moment似乎缺少顶层的导出和导入,因此我认为它只能在全局安装。来源:(打字类型)如果升级到typescript 2.0,可以使用npm安装打字。也许这会更有帮助。如果您更新了答案,将其包括在内,那么使用
npm install@types/moment
会非常有效。我会将其标记为正确。我完全更改了它,因为我首先误解了您。很高兴它成功了。