Typescript Compiler error TS2307: Cannot find module 'jquery'

爷,独闯天下 提交于 2019-12-06 01:31:36

问题


I was following JSPM getting started guide and I want to install jquery package so I execute below command.

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'. Not only for this library for other libraries I'm getting the same error.


回答1:


You need to include type definitions for jquery in the compilation context, you can grab them from https://github.com/DefinitelyTyped/DefinitelyTyped



来源:https://stackoverflow.com/questions/35102441/typescript-compiler-error-ts2307-cannot-find-module-jquery

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!