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.
2 Answers
Reset to default 5You 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!