无法将传单导入TypeScript

问题描述 投票:0回答:1

我尝试在TypeScript项目中使用leaflet。所以我的MyApp.ts文件中有以下代码:

import { L } from 'leaflet';

通过右键单击项目,通过leaflet安装了VS-Package-Installer->快速安装软件包。

但是我收到此错误:

错误TS2305(TS)模块'“ MyApp / node_modules / @ types / leaflet / index”'没有导出的成员'L'。

这是我的package.json文件:

{
  "name": "myproject",
  "version": "1.0.0",
  "devDependencies": {
    "@types/jquery": "^3.3.32",
    "@types/leaflet": "^1.5.8",
    "d3": "^5.15.0",
    "jquery": "^3.4.1",
    "leaflet": "^1.6.0",
    "leaflet-geosearch": "^2.7.0"
  }
}

对于上述依赖项,我也得到相同的错误。我已经从项目目录中删除了node-modules -filder,但无济于事。

typescript
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.