如何修复这些错误,而安装chakra-ui和react应用程序?



如何解决这些错误,而安装chakra-ui和react应用程序?

**user@user:~/Desktop/Projects$ npx create-react-app my-app --template @chakra-ui**
[Error][1]
Creating a new React app in /home/user/Desktop/Projects/my-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with @chakra-ui/cra-template...

added 1935 packages, and audited 1936 packages in 2m
125 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
Initialized a git repository.
Installing template dependencies using npm...
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: react@17.0.1
npm WARN node_modules/react
npm WARN   peer react@"17.0.1" from react-dom@17.0.1
npm WARN   node_modules/react-dom
npm WARN     react-dom@"^17.0.1" from the root project
npm WARN     4 more (framer-motion, @testing-library/react, ...)
npm WARN   54 more (the root project, @chakra-ui/react, @emotion/react, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer react@"^16.8.0" from react-remove-scroll@2.4.0
npm WARN node_modules/react-remove-scroll
npm WARN   react-remove-scroll@"2.4.0" from @chakra-ui/modal@1.4.3
npm WARN   node_modules/@chakra-ui/modal
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: react@17.0.1
npm WARN node_modules/react
npm WARN   peer react@"17.0.1" from react-dom@17.0.1
npm WARN   node_modules/react-dom
npm WARN     react-dom@"^17.0.1" from the root project
npm WARN     4 more (framer-motion, @testing-library/react, ...)
npm WARN   54 more (the root project, @chakra-ui/react, @emotion/react, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer react@"^16.8.0" from react-focus-lock@2.4.1
npm WARN node_modules/react-focus-lock
npm WARN   react-focus-lock@"2.4.1" from @chakra-ui/focus-lock@1.0.3
npm WARN   node_modules/@chakra-ui/focus-lock
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: react@17.0.1
npm WARN node_modules/react
npm WARN   peer react@"17.0.1" from react-dom@17.0.1
npm WARN   node_modules/react-dom
npm WARN     react-dom@"^17.0.1" from the root project
npm WARN     4 more (framer-motion, @testing-library/react, ...)
npm WARN   54 more (the root project, @chakra-ui/react, @emotion/react, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer react@"^16.8.0" from @reach/alert@0.11.0
npm WARN node_modules/@reach/alert
npm WARN   @reach/alert@"0.11.0" from @chakra-ui/toast@1.1.5
npm WARN   node_modules/@chakra-ui/toast
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: react-dom@17.0.1
npm WARN node_modules/react-dom
npm WARN   react-dom@"^17.0.1" from the root project
npm WARN   4 more (framer-motion, @testing-library/react, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer react-dom@"^16.8.0" from @reach/alert@0.11.0
npm WARN node_modules/@reach/alert
npm WARN   @reach/alert@"0.11.0" from @chakra-ui/toast@1.1.5
npm WARN   node_modules/@chakra-ui/toast
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR!   peer react@"17.0.1" from react-dom@17.0.1
npm ERR!   node_modules/react-dom
npm ERR!     react-dom@"^17.0.1" from the root project
npm ERR!     peer react-dom@">=16.8" from framer-motion@3.2.1
npm ERR!     node_modules/framer-motion
npm ERR!       framer-motion@">=3.0.0" from the root project
npm ERR!       8 more (@chakra-ui/react, @chakra-ui/checkbox, ...)
npm ERR!     3 more (@testing-library/react, @chakra-ui/portal, @chakra-ui/toast)
npm ERR!   react@"^17.0.1" from the root project
npm ERR!   53 more (@chakra-ui/react, @emotion/react, @emotion/styled, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.0" from @reach/utils@0.11.0
npm ERR! node_modules/@reach/alert/node_modules/@reach/utils
npm ERR!   @reach/utils@"0.11.0" from @reach/alert@0.11.0
npm ERR!   node_modules/@reach/alert
npm ERR!     @reach/alert@"0.11.0" from @chakra-ui/toast@1.1.5
npm ERR!     node_modules/@chakra-ui/toast
npm ERR!       @chakra-ui/toast@"1.1.5" from @chakra-ui/react@1.1.4
npm ERR!       node_modules/@chakra-ui/react
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 /home/user/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR!     /home/user/.npm/_logs/2021-01-17T07_29_38_104Z-debug.log
`npm install --save @chakra-ui/react@^1.0.0 @emotion/react@^11.0.0 @emotion/styled@^11.0.0 react-icons@^3.0.0 framer-motion@>=3.0.0 @testing-library/jest-dom@^5.9.0 @testing-library/react@^10.2.1 @testing-library/user-event@^12.0.2 web-vitals@^0.2.2` failed

如何修复它?

<blockquote class="imgur-embed-pub" lang="en" data-id="a/M0Rpz86" data-context="false" ><a href="//imgur.com/a/M0Rpz86"></a></blockquote><script async src="//s.imgur.com/min/embed.js" charset="utf-8"></script>

这对我有用!

npx create-react-app my-app --template @chakra-ui** --legacy-peer-deps

相关内容

  • 没有找到相关文章

最新更新