Open TommyLeong opened 3 years ago
Your lockfile seems to suggest it’s installing react-dom 16.14 somewhere, which would require react 16.14.
You can either update both react and react-dom to 16.14, or you can downgrade react-dom to 16.13. Try installing react, react-dom, and the enzyme adapter all in the same install command.
@ljharb your suggestion helps to install enzyme-adapter-react-16
successfully.. but I realized after removing the file package-lock.json
and again try to reinstall via npm install
At the same time, if I try to install other package (eg, npm i react-native-config
) I get other issue as follow
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: myapp@0.0.1
npm ERR! Found: react@16.14.0
npm ERR! node_modules/react
npm ERR! react@"16.14.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"17.0.1" from react-native-windows@0.64.3
npm ERR! node_modules/react-native-windows
npm ERR! peer react-native-windows@">=0.61" from react-native-config@1.4.2
npm ERR! node_modules/react-native-config
npm ERR! react-native-config@"*" 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.
In short, switching react
and react-dom
to version 16.14.0 resolved my installation but raise other issues.
That means that version of react-native-windows
requires react 17, which means it's incompatible with react 16 and can't be used. You'll either have to remove it, or downgrade it to one that supports react 16.
Current behavior
Tried to install
enzyme-adapter-react-16
with React-Native Version0.63.2
and React16.13.1
Installation command
npm i --save-dev enzyme-adapter-react-16
Error received
Expected behavior
To install successfully
Your environment
Package.json
Machine
Adapter