Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在我的项目中使用 react-leaflet v.2.8。我想将 react-leaflet 升级到 v.3。但是怎么做?当我写“npm i react-leaflet”时,它只安装了 react-leaflet v.2.8。
单程:
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 版有很多重大更改,因此请准备好更新您的代码库。