gpt4 book ai didi

reactjs - 没有安装 react-leaflet 库

转载 作者:行者123 更新时间:2023-12-05 09:17:03 24 4
gpt4 key购买 nike

当我尝试导入库“react-leaflet”时,出现此错误:

ERROR in ./node_modules/react-leaflet/lib/propTypes/map.js
Module not found: Error: Can't resolve 'leaflet' in 'D:\PycharmProjects\adminora\node_modules\react-leaflet\lib\propTypes'
@ ./node_modules/react-leaflet/lib/propTypes/map.js 5:15-33
@ ./node_modules/react-leaflet/lib/Map.js
@ ./node_modules/react-leaflet/lib/index.js

编辑: 我的 package.json 文件:

  "dependencies": {
"@types/react": "^16.0.36",
"babel-polyfill": "^6.26.0",
"classnames": "^2.2.5",
"history": "^4.7.2",
"jwt-decode": "^2.2.0",
"material-ui": "^1.0.0-beta.27",
"material-ui-icons": "^1.0.0-beta.17",
"prop-types": "^15.6.0",
"react": "^16.2.0",
"react-block-ui": "^1.1.1",
"react-dom": "^16.2.0",
"react-leaflet": "^1.8.1",
}

最佳答案

你还需要安装依赖包,尝试使用

npm install leaflet prop-types react react-dom react-leaflet

关于reactjs - 没有安装 react-leaflet 库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48942215/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com