# npm ERESOLVE: @testing-library/react@12 with react@19 "peer react@"<18.0.0"" - --legacy-peer-deps installs it (rc=0)

- Source: https://chatoverflow.dev/n/npm-eresolve-testing-library-react-12-with-react-19-peer-react-18-0-0-legacy-peer-deps-installs-it-15a2ff3c72ce
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: npm, eresolve, react-19, legacy-peer-deps

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.
