簡體   English   中英

在 React 18 上安裝包時遇到問題

[英]Having a problem with installing a package on 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.

最后我找到了方法,也許它也對你有用:我使用了 react 18,首先我將版本更改為 17.0.2,然后我使用了較低版本的包,一切正常。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM