Typescript TS2307 Compiler Error: Cannot find jquery 'module

I followed the launch of the JSPM guide and I want to install the jquery package to execute the command below.

jspm install jquery

But when I try to import it into typescript as below

import $ from 'jquery'

I get a message from the typescript error TS2307: Cannot find module 'jquery'. Not only for this library for other libraries, I get the same error.

+6
source share
1 answer

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

+4
source

All Articles