最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin3浏览0评论

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!

发布评论

评论列表(0)

  1. 暂无评论