Skip to content

Having Issue will creating react app #13715

Open

Description

@weprixetechnologies

I am facing such Issue: - Please Provide Solution on this.

My Node Version is v22.12.0
NPM VERSION 10.9.0
NPX VERSION 10.9.0

darksoul@Ronits-MacBook-Air ~ % npx create-react-app hello

Creating a new React app in /Users/darksoul/hello.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...

added 1314 packages in 38s

261 packages are looking for funding
run npm fund for details

Initialized a git repository.

Installing template dependencies using npm...
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: hello@0.1.0
npm error Found: react@19.0.0
npm error node_modules/react
npm error react@"^19.0.0" from the root project
npm error
npm error Could not resolve dependency:
npm error peer react@"^18.0.0" from @testing-library/react@13.4.0
npm error node_modules/@testing-library/react
npm error @testing-library/react@"^13.0.0" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /Users/darksoul/.npm/_logs/2024-12-06T07_30_06_577Z-eresolve-report.txt
npm error A complete log of this run can be found in: /Users/darksoul/.npm/_logs/2024-12-06T07_30_06_577Z-debug-0.log
npm install --no-audit --save @testing-library/jest-dom@^5.14.1 @testing-library/react@^13.0.0 @testing-library/user-event@^13.2.1 web-vitals@^2.1.0 failed
darksoul@Ronits-MacBook-Air ~ %

Activity

  1. annaStoyanov commented on Dec 6, 2024

    @annaStoyanov

    Me too.
    This was working fine

    npm install --global yarn
    yarn create react-app my-app --template typescriptyarn
    cd my-app
    yarn start

  2. irvelervel commented on Dec 6, 2024

    @irvelervel

    I can confirm too, yesterday was working fine and it just broke.

  3. aityahiaidir commented on Dec 6, 2024

    @aityahiaidir

    i confirme i have the same issue

  4. rawadtraboulsi commented on Dec 6, 2024

    @rawadtraboulsi

    facing the same issue too

  5. Neoprot commented on Dec 6, 2024

    @Neoprot

    Seems like react just updated to 19, and the script prob just try to pick the latest react version, and now its 19 and the other dependencies are expecting react 18 which is why it gives this error

  6. AliFahmy commented on Dec 6, 2024

    @AliFahmy

    I am facing this issue too, is there any work arounds?

  7. aityahiaidir commented on Dec 6, 2024

    @aityahiaidir

    with yarn it's work
    yarn create react-app my-app

  8. Yangbao-Jin commented on Dec 7, 2024

    @Yangbao-Jin

    same issue,why??? all of a sudden,it doesn't work!

  9. Yangbao-Jin commented on Dec 7, 2024

    @Yangbao-Jin

    Seems like react just updated to 19, and the script prob just try to pick the latest react version, and now its 19 and the other dependencies are expecting react 18 which is why it gives this error

    any solution?

  10. thcpdd commented on Dec 8, 2024

    @thcpdd

    I have a same error too.

  11. JingqiGao-2 commented on Dec 9, 2024

    @JingqiGao-2

    I hope this problem is solved and we can sync up

  12. hashmatjibran commented on Dec 9, 2024

    @hashmatjibran

    i also face this issue @Neoprot said it right . it is the version 19 upgrade issue. i used a downgraded version of react app to solve this issue ryt now.

  13. AimanFariz commented on Dec 9, 2024

    @AimanFariz

    same problem as well. anyone pls let me know when there's a solution

  14. AimanFariz commented on Dec 9, 2024

    @AimanFariz

    with yarn it's work yarn create react-app my-app

    Okay this works. maybe just use yarn until facebook releases a patch for the npx

  15. iamrajhans commented on Dec 11, 2024

    @iamrajhans
    Contributor

    I was also facing the same issue, tried below steps

    $ npx create-react-app my-app
    

    which will give above error

    npm error react@"^19.0.0" from the root project
    npm error
    npm error Could not resolve dependency:
    npm error peer react@"^18.0.0" from @testing-library/react@13.4.0

    possibly this is happening due to the latest version of react (19) and testing-library/react@13.4.0 as it supports react version 18

    React Testing Library versions 13+ require React v18.

    after running above command now update the my-app/node_modules/cra-template/template.json file, update react-testing-library to 16 version from 13.4.0 version

    "@testing-library/react":  "^16.0.0",

    after this run below command

    $ npm i && npm i web-vitals --save-dev && npm start
    

    OR update the react version to 18

    $ npx create-react-app my-app
    

    after this update the package.json file with react and react-dom version to 18

    "react": "^18.0.0",
    "react-dom": "^18.0.0",

    and run below

    $ npm i && npm i web-vitals --save-dev && npm start
    
  16. CD-Rom01100001 commented on Dec 16, 2024

    @CD-Rom01100001

    Я тоже столкнулся с той же проблемой, попробовал следующие шаги

    $ npx create-react-app my-app
    

    что даст вышеуказанную ошибку

    npm error react@"^19.0.0" из корневого проекта
    npm error
    npm error Не удалось разрешить зависимость:
    npm error peer react@"^18.0.0" из @testing-library/react@13.4.0

    возможно, это происходит из-за последней версии React (19) и testing-library/react@13.4.0, так как она поддерживает React версии 18

    Для библиотеки тестирования React версии 13+ требуется React v18.

    после запуска вышеуказанной команды обновите my-app/node_modules/cra-template/template.jsonфайл, обновите react-testing-library до версии 16 с версии 13.4.0

    "@testing-library/react":  "^16.0.0",

    после этого выполните следующую команду

    $ npm i && npm i web-vitals --save-dev && npm start
    

    ИЛИ обновите версию React до 18

    $ npx create-react-app my-app
    

    после этого обновите package.jsonфайл с react и react-dom версии до 18

    "react": "^18.0.0",
    "react-dom": "^18.0.0",

    и бегите ниже

    $ npm i && npm i web-vitals --save-dev && npm start
    

    Я тоже столкнулся с той же проблемой, попробовал следующие шаги

    $ npx create-react-app my-app
    

    что даст вышеуказанную ошибку

    npm error react@"^19.0.0" из корневого проекта
    npm error
    npm error Не удалось разрешить зависимость:
    npm error peer react@"^18.0.0" из @testing-library/react@13.4.0

    возможно, это происходит из-за последней версии React (19) и testing-library/react@13.4.0, так как она поддерживает React версии 18

    Для библиотеки тестирования React версии 13+ требуется React v18.

    после запуска вышеуказанной команды обновите my-app/node_modules/cra-template/template.jsonфайл, обновите react-testing-library до версии 16 с версии 13.4.0

    "@testing-library/react":  "^16.0.0",

    после этого выполните следующую команду

    $ npm i && npm i web-vitals --save-dev && npm start
    

    ИЛИ обновите версию React до 18

    $ npx create-react-app my-app
    

    после этого обновите package.jsonфайл с react и react-dom версии до 18

    "react": "^18.0.0",
    "react-dom": "^18.0.0",

    и бегите ниже

    $ npm i && npm i web-vitals --save-dev && npm start
    

    Thanks, it worked! I hope they will fix this problem soon.

  17. yhojann-cl commented on Dec 25, 2024

    @yhojann-cl

    Wrong repository, the problem is not for React Scripts, is Testing Library for React: testing-library/react-testing-library#1372

  18. Ismailkh356 commented on Jan 9, 2025

    @Ismailkh356

    I am facing such Issue: - Please Provide Solution on this.

    My Node Version is v22.12.0 NPM VERSION 10.9.0 NPX VERSION 10.9.0

    darksoul@Ronits-MacBook-Air ~ % npx create-react-app hello

    Creating a new React app in /Users/darksoul/hello.

    Installing packages. This might take a couple of minutes. Installing react, react-dom, and react-scripts with cra-template...

    added 1314 packages in 38s

    261 packages are looking for funding run npm fund for details

    Initialized a git repository.

    Installing template dependencies using npm... npm error code ERESOLVE npm error ERESOLVE unable to resolve dependency tree npm error npm error While resolving: hello@0.1.0 npm error Found: react@19.0.0 npm error node_modules/react npm error react@"^19.0.0" from the root project npm error npm error Could not resolve dependency: npm error peer react@"^18.0.0" from @testing-library/react@13.4.0 npm error node_modules/@testing-library/react npm error @testing-library/react@"^13.0.0" from the root project npm error npm error Fix the upstream dependency conflict, or retry npm error this command with --force or --legacy-peer-deps npm error to accept an incorrect (and potentially broken) dependency resolution. npm error npm error npm error For a full report see: npm error /Users/darksoul/.npm/_logs/2024-12-06T07_30_06_577Z-eresolve-report.txt npm error A complete log of this run can be found in: /Users/darksoul/.npm/_logs/2024-12-06T07_30_06_577Z-debug-0.log npm install --no-audit --save @testing-library/jest-dom@^5.14.1 @testing-library/react@^13.0.0 @testing-library/user-event@^13.2.1 web-vitals@^2.1.0 failed darksoul@Ronits-MacBook-Air ~ %

    I had Resolve the issue..

    I had overcome this issue, i had used many ways and technique but i doesn't work.
    Here's how i resolve the issue_
    First you need to remove all the npm caches etc then use this commands one by one..

    "npm create vite@latest my-app -- --template react
    cd my-app
    npm install
    npm run dev
    "
    After running the last command, will see "http://localhost:3000/" You can access it just copy it and run on the browser then start developing..

    I'm hopping that this would works fine. If yes please to forgot to tell me or please follow me for more....

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions