3
respostas

estou com problema em começar um novo projeto React

$ npx create-react-app novo-app

Creating a new React app in C:\Users\Raquel Rodrigues\novo-app.

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

added 1326 packages in 3m

268 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: novo-app@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 C:\Users\Raquel Rodrigues\AppData\Local\npm-cache_logs\2025-02-08T22_24_38_891Z-eresolve-report.txt npm error A complete log of this run can be found in: C:\Users\Raquel Rodrigues\AppData\Local\npm-cache_logs\2025-02-08T22_24_38_891Z-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 estou tentanto fazer um novo projeto react mais está dando esse erro a cima, como arrumo isso?

3 respostas

Boa noite,

O comando que você está utilizando (Create React App) foi descontinuado e não é recomendado atualmente. Recomendo criar um projeto utilizando o Vite.

Para criar um projeto com Vite:

npm create vite@latest

Caso queira tentar outras alternativas para criar projetos React, indico o vídeo do Código Fonte TV.

Se ainda estiver enfrentando erros ao tentar criar projetos, tente atualizar o Node.js.

agora deu certo, muito obrigado

Eu estava com o mesmo problema, mas agora deu certo !

Obrigada!