【发布时间】:2021-03-12 03:48:07
【问题描述】:
我正在尝试更新到 react@17.0.1 和 react-native@0.64.0-rc.0 但我遇到了以下错误:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: undefined@undefined
npm ERR! Found: react@16.13.1
npm ERR! node_modules/react
npm ERR! react@"16.13.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"17.0.1" from react-native@0.64.0-rc.0
npm ERR! node_modules/react-native
npm ERR! react-native@"0.64.0-rc.0" 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.
我目前正在使用 React 16.13.1 和 React Native 0.63.4。关于如何解决这个问题的任何想法?
只需使用 --verbose 运行它,也得到了这个:
npm notice
npm verb stack Error: unable to resolve dependency tree
npm verb stack at Arborist.[failPeerConflict] (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1143:25)
npm verb stack at Arborist.[placeDep] (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1242:32)
npm verb stack at /usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:851:46
npm verb stack at Array.map (<anonymous>)
npm verb stack at Arborist.[buildDepStep] (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:851:8)
npm verb stack at processTicksAndRejections (node:internal/process/task_queues:94:5)
npm verb stack at async Arborist.buildIdealTree (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:209:7)
npm verb stack at async Promise.all (index 1)
npm verb stack at async Arborist.reify (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:131:5)
npm verb stack at async Install.install (/usr/local/lib/node_modules/npm/lib/install.js:120:5)
npm verb cwd /Users/x/Development/App
npm verb Darwin 20.3.0
npm verb argv "/usr/local/Cellar/node/15.9.0/bin/node" "/usr/local/bin/npm" "install" "react@17.0.1" "--verbose"
npm verb node v15.9.0
npm verb npm v7.6.2
【问题讨论】:
标签: react-native npm