[英]Typescript Compiler error TS2307: Cannot find module 'jquery'
I was following JSPM getting started guide and I want to install jquery package so I execute below command.我正在关注 JSPM 入门指南,我想安装 jquery 包,所以我执行以下命令。
jspm install jquery
But when I try to import it in typescript like below但是当我尝试像下面这样在打字稿中导入它时
import $ from 'jquery'
I'm getting a error from typescript compiler saying error TS2307: Cannot find module 'jquery'.
我收到来自打字稿编译器的
error TS2307: Cannot find module 'jquery'.
Not only for this library for other libraries I'm getting the same error.不仅对于其他库的这个库,我也遇到了同样的错误。
您需要在编译上下文中包含jquery
类型定义,您可以从https://github.com/DefinitelyTyped/DefinitelyTyped获取它们
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.