簡體   English   中英

我正在嘗試使用“npm i react-draft-wysiwyg”命令安裝軟件包,但它不起作用

[英]I'm trying to install package using 'npm i react-draft-wysiwyg' command but it not working

當我嘗試使用“npm i react-draft-wysiwyg”安裝軟件包時,它給了我以下錯誤:

`npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: my-app@0.1.0
npm ERR! Found: react@18.2.0
npm ERR! node_modules/react
npm ERR! react@"^18.2.0" from the root project
npm ERR! peer react@">=0.14.0" from draft-js@0.11.7
npm ERR! node_modules/draft-js
npm ERR! draft-js@"^0.11.7" from the root project
npm ERR! peer draft-js@"^0.10.x || ^0.11.x" from react-draft-wysiwyg@1.14.7
npm ERR! node_modules/react-draft-wysiwyg
npm ERR! react-draft-wysiwyg@"" from the root project
npm ERR! 1 more (react-dom)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"0.13.x || 0.14.x || ^15.0.0-0 || 15.x.x || ^16.0.0-0 || ^16.x.x || ^17.x.x" from react-draft-wysiwyg@1.14.7
npm ERR! node_modules/react-draft-wysiwyg
npm ERR! react-draft-wysiwyg@"" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!

我遇到了同樣的問題,但最后我得到了解決方案。 100% 解決。 只需在您的項目中使用此命令:

npm config set legacy-peer-deps true

暫無
暫無

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

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