安装 mocha 的 TypeScript 定义失败

Installing TypeScript definitions of mocha fails

我不太明白这个错误消息以及如何解决这个问题。 我正在尝试安装 mocha 的类型定义,但我得到的只是以下错误消息:

$ typings install env~mocha
Attempted to compile "mocha" as an external module, but it looks like a global module.

我该如何解决这个问题?

将其安装为全局模块(以前称为 ambient module)。

$ typings install env~mocha --global