Typescript Compiler error TS2307: Cannot find modu

2019-04-07 01:02发布

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条回答
smile是对你的礼貌
2楼-- · 2019-04-07 01:35

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

查看更多
登录 后发表回答