簡體   English   中英

由於依賴沖突,npm chakra-ui 安裝失敗

[英]npm chakra-ui install failing due to dependency conflicts

我正在嘗試學習 react/typescript,並且我正在逐行遵循教程,但是在嘗試安裝 @chakra-ui/react 或 @chakra-ui/core 時不知何故出現此錯誤。 似乎反應已更新的依賴問題。 我應該回滾反應嗎?

kyoudai.industries git:(master) ✗ npm install @chakra-ui/react framer-motion
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: kyoudai.industries@1.0.0
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR!   react@"^17.0.1" from the root project
npm ERR!   peer react@"16.x || 17.x" from @chakra-ui/react@1.0.1
npm ERR!   node_modules/@chakra-ui/react
npm ERR!     @chakra-ui/react@"*" from the root project
npm ERR!   2 more (@emotion/react, @emotion/styled)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8" from framer-motion@2.9.4
npm ERR! node_modules/framer-motion
npm ERR!   framer-motion@"*" from the root project
npm ERR!   peer framer-motion@"^2.9.4" from @chakra-ui/react@1.0.1
npm ERR!   node_modules/@chakra-ui/react
npm ERR!     @chakra-ui/react@"*" 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! 
npm ERR! See /Users/travis/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/travis/.npm/_logs/2020-11-24T22_38_57_297Z-debug.log

使用此命令,您可以解決問題:

npm i @chakra-ui/react --legacy-peer-deps

我有同樣的問題,但在 Vue.js 中。 我運行了以下命令,它開始工作:

vue create test -p default && cd test && vue serve src/main.js,

似乎它創建了一個運行一些測試的文件夾。

然后我跑了: npm i -g @vue/cli-service-global. .

然后: npm run serve--啟動vue服務器。

希望它能讓你了解如何在 React 中解決這個問題。 祝你好運!

暫無
暫無

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

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