Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to create react app with typescript #13767

Open
underager opened this issue Dec 27, 2024 · 2 comments
Open

Unable to create react app with typescript #13767

underager opened this issue Dec 27, 2024 · 2 comments

Comments

@underager
Copy link

Hi,
So I have been trying to create a react app with the following command
"npx create-react-app my-app --template typescript"

         However, upon running the command I am getting the following set of errors

         Installing template dependencies using npm...
          npm ERR! code ERESOLVE
          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@"^19.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@"^13.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!

         Could you please suggest on how to move ahead from here.

Thanks

@franklinrizzy
Copy link

When creating a new React app using create-react-app with React@19, you might encounter issues related to the web-vitals package.
To resolve this:
Run the following command to install the package: 'npm i web-vitals'
After installation, everything should work as expected.

@lstrzelecki
Copy link

@franklinrizzy When I run create-react-app --template typescript it fails but it doesn't create tsconfig.json (I'm not sure if it should be generated in the latest version). But even I installed web-vitals. The application doesn't start

Module not found: Error: Can't resolve './App'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants