Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

157
Views
Downgrade React v17 to v18 created using npx

How can I downgrade project created with "npx create-react-app . --template typescript". All posts I find online suggest manually changing dependencies then to run "npm install" but there's always some error when I do that. How can I modify dependencies to make it work with react v17 ?

here's my attempt to downgrade :

"dependencies": {
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.2.0",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.5.1",
"@types/node": "^16.11.36",
"@types/react": "^17.0.2",
"@types/react-dom": "^17.0.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "5.0.1",
"typescript": "^4.6.4",
"web-vitals": "^2.1.4"

}

and here is errors:

npm WARN ERESOLVE overriding peer dependency

npm WARN While resolving: hard-keys-react17@0.1.0

npm WARN Found: react@18.1.0

npm WARN node_modules/react

npm WARN react@"^17.0.2" from the root project

npm WARN 3 more (@testing-library/react, react-dom, react-scripts)

npm WARN

npm WARN Could not resolve dependency:

npm WARN peer react@"^18.0.0" from @testing-library/react@13.2.0

npm WARN node_modules/@testing-library/react

npm WARN @testing-library/react@"^13.2.0" from the root project

npm WARN ERESOLVE overriding peer dependency

npm WARN While resolving: hard-keys-react17@0.1.0

npm WARN Found: react@18.1.0

npm WARN node_modules/react

npm WARN react@"^17.0.2" from the root project

npm WARN 3 more (@testing-library/react, react-dom, react-scripts)

npm WARN

npm WARN Could not resolve dependency:

npm WARN peer react@"^18.1.0" from react-dom@18.1.0

npm WARN node_modules/react-dom

npm WARN react-dom@"^17.0.2" from the root project

npm WARN 1 more (@testing-library/react)

npm WARN ERESOLVE overriding peer dependency

npm WARN While resolving: hard-keys-react17@0.1.0

npm WARN Found: react-dom@18.1.0

npm WARN node_modules/react-dom

npm WARN react-dom@"^17.0.2" from the root project

npm WARN 1 more (@testing-library/react)

npm WARN

npm WARN Could not resolve dependency:

npm WARN peer react-dom@"^18.0.0" from @testing-library/react@13.2.0

npm WARN node_modules/@testing-library/react

npm WARN @testing-library/react@"^13.2.0" from the root project

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You could always run

npm resolve dependencies

Manually downgrading might throw some warning tell you that there are newer version than the one you are using now but its still work all the same.

And you made a mistake in your package.json

"react-scripts": "5.0.1",

Make it

"react-scripts": "^5.0.1",
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!