卸载全局输入,不允许我重新安装

时间:2016-09-26 11:42:09

标签: angular typescript ionic2

我已经安装了使用typings install dt~moment --save --global

进行全局输入的时刻

正在运行typings list给我:

├── lodash@4.0.0
├── es6-shim (global)
└── moment (global)

我决定使用typings uninstall moment --global

卸载它

正在运行typings list给我:

├── lodash@4.0.0
└── es6-shim (global)

现在我使用typings install dt~moment --save安装在当前目录中并收到以下错误:

typings ERR! message Attempted to compile "moment" as an external module, but it looks like a global module. You'll need to enable the global option to continue.

为什么到底发生这种情况,我还试图清除以前没有帮助的缓存。

node v5
npm v3.3.9
tsc v1.8.10

1 个答案:

答案 0 :(得分:2)

编辑: 如果你升级到typescript 2.0,你可以用npm安装打字。

npm install @types/moment

https://blogs.msdn.microsoft.com/typescript/2016/06/15/the-future-of-declaration-files/ https://www.npmjs.com/package/@types/moment

也许这有帮助。