我在我的项目中使用react-leaflet v.2.8。我想将react-leaflet升级到v.3。但是怎么做呢?当我写"npm I react-leaflet“时,它只安装了react-leaflet v.2.8。
发布于 2021-07-13 02:23:31
一种方法:
npm uninstall react-leaflet
npm install react-leaflet
另一种方式:
转到您的package.json,并将react-leaflet的任何版本号更改为npm上列出的最新版本。然后,它在package.json中应该如下所示:
"react-leaflet": "^3.2.0"
然后运行npm install react-leaflet
请记住,从版本2到版本3有很多突破性的变化,所以要准备好更新您的代码库。
https://stackoverflow.com/questions/68351426
复制相似问题