小编Mar*_*gen的帖子

找不到模块:无法解析“react-leaflet”

在尝试运行一些示例代码时,我收到编译错误;

"Module not found: Can't resolve 'react-leaflet' in 'C:\Users...\my-app\src\map'"
Run Code Online (Sandbox Code Playgroud)

我正在尝试使用react和typescipt来做到这一点,并使用“react-leaflet”

我已经尝试安装 types@react-leaflet 和 react-leaflet

这是我的依赖项:

"dependencies": {
    "@types/jest": "24.0.15",
    "@types/leaflet": "^1.4.4",
    "@types/node": "12.0.8",
    "@types/react": "16.8.20",
    "@types/react-dom": "16.8.4",
    "@types/react-leaflet": "^2.2.1",
    "leaflet": "^1.5.1",
    "react": "^16.8.6",
    "react-dom": "^16.8.6",
    "react-scripts": "3.0.1",
    "save": "^2.4.0",
    "typescript": "3.5.2"
  }
Run Code Online (Sandbox Code Playgroud)

typescript reactjs react-leaflet

3
推荐指数
1
解决办法
1万
查看次数

标签 统计

react-leaflet ×1

reactjs ×1

typescript ×1