admin管理员组

文章数量:1356413

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!

本文标签: javascriptTypescript Compiler error TS2307 Cannot find module 39jquery39Stack Overflow