简体   繁体   中英

Having a problem with installing a package on React 18

I tried to install react-neshan-map-leaflet and everything was installed well without errors,

After the project started, I saw this error:

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM