javascript - Typescript Compiler error TS2307: Cannot find module 'jquery' - Stack Overflow

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

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

jspm install jquery

But when I try to import it in typescript like below

import $ from 'jquery'

I'm getting a error from typescript piler saying error TS2307: Cannot find module 'jquery'. Not only for this library for other libraries I'm getting the same error.

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

jspm install jquery

But when I try to import it in typescript like below

import $ from 'jquery'

I'm getting a error from typescript piler saying error TS2307: Cannot find module 'jquery'. Not only for this library for other libraries I'm getting the same error.

Share Improve this question edited Jan 30, 2016 at 15:46 Vadim Macagon 14.9k2 gold badges54 silver badges45 bronze badges asked Jan 30, 2016 at 13:36 ShabithShabith 3,0053 gold badges26 silver badges20 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 5

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

I encountered on exactly same kind of error during VSBuild on Azure DevOps.

In my case, solution was just add new extra step Install npm into build pipeline and error was gone.

I hope it will help somebody!

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744047304a4549417.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信