javascript - 在 React 18 上安装软件包时遇到问题

我尝试安装 react-neshan-map-leaflet 并且一切都安装得很好,没有错误,

项目启动后,我看到了这个错误:

ERROR in ./node_modules/react-neshan-map-leaflet/dist/NeshanMap.js 2:0-60
Module not found: Error: Can't resolve './loaders/neshan_map_loader' in 'C:\Users\Desktop\time-line\node_modules\react-neshan-map-leaflet\dist'
Did you mean 'neshan_map_loader.js'?
BREAKING CHANGE: The request './loaders/neshan_map_loader' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

回答1

最后我找到了方法,也许它也对你有用:我使用了 react 18 ,首先我将版本更改为 17.0.2 ,然后我使用了较低版本的包并且一切正常。

相似文章

math - 数字之间的和与差

是否可以找到两个数字a和b使得a和b之间的差等于a和b中的数字之和?是否可以为此编写一个通用方程?...

随机推荐

最新文章