打字总是抱怨全局模块 [英] typings always complaining about global module

查看:70
本文介绍了打字总是抱怨全局模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对打字稿很陌生.无论我尝试安装哪种类型,我都会得到:

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆