简体   繁体   English

如何在Typescript中导入外部依赖项?

[英]How to import external dependencies in Typescript?

I want to import JQuery using Typescript and I do what the official tutorial of Typescript say: 我想使用Typescript导入JQuery,然后执行Typescript的官方教程所说的:

import * as $ from "jquery";

Still, I get an error: 仍然,我得到一个错误:

"cannot find module jquery" “找不到模块jQuery”

Do you have any idea how to resolve this issue? 您知道如何解决此问题吗?

You need to install Typescript typings for the library. 您需要为库安装Typescript类型。 Run npm install -SD @types/jquery 运行npm install -SD @types/jquery

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM