打字总是抱怨全局模块 [英] typings always complaining about global module
问题描述
我对打字稿很陌生.无论我尝试安装哪种类型,我都会得到:
I am very new to typescript. Whatever typings I try to install, I get:
输入错误! message试图将"angular"编译为外部模块,但看起来像全局模块.
typings ERR! message Attempted to compile "angular" as an external module, but it looks like a global module.
我只是想做
typings install dt~angular
我在做什么错了?
更新: 如果您来这里了解的很少(就像我写这个问题时一样),请考虑使用npm/@ types. 更多信息和讨论.
Update: If you are coming here with little knowledge (as I was when writing this question) - consider using npm/@types. More info and discussion.
推荐答案
如错误消息所提示,您应使用--global选项:
As error message suggests, you should use --global option:
typings install dt~angular --global --save
请参见 IntelliJ IDEA/>中的详细分步教程,以设置具有TypeScript支持的Node.js项目. Webstorm 或 Visual Studio代码
TypeScript及其周围的工具发展非常迅速.昨天起作用的东西不再起作用了.
TypeScript and tools around it are evolving very fast. What worked yesterday don't work any more.
这篇关于打字总是抱怨全局模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!