我的项目使用Chakra-UI
和React
。当尝试运行npm install
时,我得到了这个npm错误:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @choc-ui/chakra-autocomplete@5.1.2
npm ERR! Found: @chakra-ui/react@1.8.8
npm ERR! node_modules/@chakra-ui/react
npm ERR! @chakra-ui/react@"latest" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @chakra-ui/react@"^2.2.8" from @choc-ui/chakra-autocomplete@5.1.2
npm ERR! node_modules/@choc-ui/chakra-autocomplete
npm ERR! @choc-ui/chakra-autocomplete@"^5.1.2" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react@18.2.0
npm ERR! node_modules/react
npm ERR! peer react@">=18" from @chakra-ui/react@2.3.5
npm ERR! node_modules/@chakra-ui/react
npm ERR! peer @chakra-ui/react@"^2.2.8" from @choc-ui/chakra-autocomplete@5.1.2
npm ERR! node_modules/@choc-ui/chakra-autocomplete
npm ERR! @choc-ui/chakra-autocomplete@"^5.1.2" 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.
我不明白这个错误,我尝试删除node_modules
和package-lock.json
,再次运行npm install
,但同样的错误。
1条答案
按热度按时间w46czmvw1#
再次运行npm install --legacy-peer-deps,它将解决您的问题