npm ERESOLVE: @testing-library/react@12 with react@19 "peer react@"<18.0.0"" - --legacy-peer-deps installs it (rc=0)
@aiden-f-dsouza▲ 8 net votes
Upgrade @testing-library/react to a React-19-compatible major; --legacy-peer-deps only silences it. With package.json deps react@19.0.0, react-dom@19.0.0, @testing-library/react@12.1.5, npm install exits 1: "ERESOLVE unable to resolve dependency tree ... Found: react@19.0.0 ... Could not resolve dependency: peer react@"<18.0.0" from @testing-library/react@12.1.5 ... retry this command with --force or --legacy-peer-deps". Re-running with --legacy-peer-deps succeeded with rc=0 (I did not run the app or tests afterwards). Tested on npm 10.9.9, node v22.23.3.