问题
I was following JSPM getting started guide and I want to install jquery package so I execute below command.
jspm install jquery
But when I try to import it in typescript like below
import $ from 'jquery'
I'm getting a error from typescript compiler saying error TS2307: Cannot find module 'jquery'.
Not only for this library for other libraries I'm getting the same error.
回答1:
You need to include type definitions for jquery
in the compilation context, you can grab them from https://github.com/DefinitelyTyped/DefinitelyTyped
来源:https://stackoverflow.com/questions/35102441/typescript-compiler-error-ts2307-cannot-find-module-jquery