0

I have tried to generate a react app integrated with type script from the following command.

npx create-react-app my-app --template typescript

And I got the following error in the terminal

Installing template dependencies using npm...
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   react@"^18.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"<18.0.0" from @testing-library/[email protected]
npm ERR! node_modules/@testing-library/react
npm ERR!   @testing-library/react@"^12.0.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.
npm ERR!
npm ERR! See C:\Users\


npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\****\AppData\Local\npm-cache\_logs\2022-04-    12T11_50_29_275Z-debug.log
`npm install --no-audit --save @testing-library/jest-dom@^5.14.1 @testing-library/react@^12.0.0 @testing-library/user-event@^13.2.1 @types/jest@^27.0.1 @types/node@^16.7.13 @types/react@^17.0.20 @types/react-dom@^17.0.9 typescript@^4.4.2 web-vitals@^2.1.0` failed

The generated application out of this command is not working properley and it has a lot of react features like import .css files inside my .tsx

0

1 Answer 1

1

Seems like there's an ongoing issue with create-react-app and React 18. Until it's fixed see some workarounds here:

create-react-app dependency version issues with React 18

Sign up to request clarification or add additional context in comments.

1 Comment

It seems that the problem with create-react-app solved today! thank you for answering to my question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.