嘿,我遇到了问题npm install
。我收到错误。我该如何修复?
npm install
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @use-it/[email protected]
npm WARN Found: [email protected]
npm WARN node_modules/react
npm WARN react@"^17.0.2" from the root project
npm WARN 32 more (@devexpress/dx-react-core, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"^16.8.0" from @use-it/[email protected]
npm WARN node_modules/@use-it/event-listener
npm WARN @use-it/event-listener@"^0.1.2" from [email protected]
npm WARN node_modules/use-dark-mode
npm WARN 1 more (use-persisted-state)
npm WARN
npm WARN Conflicting peer dependency: [email protected]
npm WARN node_modules/react
npm WARN peer react@"^16.8.0" from @use-it/[email protected]
npm WARN node_modules/@use-it/event-listener
npm WARN @use-it/event-listener@"^0.1.2" from [email protected]
npm WARN node_modules/use-dark-mode
npm WARN 1 more (use-persisted-state)
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/prettier
npm ERR! prettier@"^2.3.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer prettier@"^1.3.1" from [email protected]
npm ERR! node_modules/prettierrc
npm ERR! prettierrc@"0.0.0-5" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/prettier
npm ERR! peer prettier@"^1.3.1" from [email protected]
npm ERR! node_modules/prettierrc
npm ERR! prettierrc@"0.0.0-5" 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 C:\Users\{user}\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\{user}\AppData\Local\npm-cache\_logs\2022-06-22T15_37_55_849Z-debug-0.log
答案1
使用npm i --force
或npm i ----legacy-peer-deps
修复多反应版本冲突。