npx create-react-app cra-react-app 실행시 에러가 발생합니다.
290
작성한 질문수 1
뭔가 잘 모르겠는데.. 아래 확인 부탁드려도 될까요?
설정한것도 없는것 같은데 기본 생성 명령어자체가 실행이 안된다니..ㅠㅠㅠㅠ
manijang2@gimseonman-ui-MacBookAir VSProjects % npx create-react-app cra-react-app
Creating a new React app in /Users/manijang2/VSProjects/cra-react-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
added 1324 packages in 40s
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: cra-react-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 /Users/manijang2/.npm/_logs/2025-02-03T13_23_36_276Z-eresolve-report.txt
npm error A complete log of this run can be found in: /Users/manijang2/.npm/_logs/2025-02-03T13_23_36_276Z-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
manijang2@gimseonman-ui-MacBookAir VSProjects %
답변 3
0

이러한 에러가 나는데 무슨 설정을 안 해서 그럴까요?
0
안녕하세요 🙂
이 에러는 React 버전 충돌로 인해 발생한오류로
https://github.com/facebook/react/issues/32016 깃헙에서도 다루고 있는데요.
아래와 같이 버전을 낮춰 진행하시면 됩니다.
npx create-react-app my-app
cd my-app
npm install react@18 react-dom@18 react-scripts web-vitals
npm run start
0
안녕하세요, 인프런 AI 인턴입니다. 김선만님, React 애플리케이션 생성을 시도할 때 발생하는 에러에 대한 해결책을 안내해 드리겠습니다.
해당 에러는 주로 패키지 간의 의존성 충돌 때문에 발생합니다. 특히, react 버전과 @testing-library/react가 서로 호환되지 않는 버전을 사용하고 있어서 발생한 것으로 보입니다.
해결 방법은 다음과 같습니다:
패키지 충돌 해결:
npx create-react-app명령어에--legacy-peer-deps옵션을 추가하여 의존성 문제를 무시하도록 지시할 수 있습니다.npx create-react-app cra-react-app --legacy-peer-deps강제 설치 시도: 만약 위 방법이 작동하지 않는다면
--force옵션을 사용해서 다시 시도해 볼 수 있습니다.npx create-react-app cra-react-app --force
이러한 옵션은 의존성 관련 경고를 무시하며 설치를 진행하기 때문에 경우에 따라 모든 기능이 완벽히 작동하지 않을 수 있습니다. 이러한 경우, 설치 중 추가로 볼 수 있는 로그를 함께 확인하여 필요한 부분을 직접 수정해야 할 수도 있습니다.
더불어, 아래는 유사한 문제가 해결된 적 있는 게시물의 자료입니다. 참고해 보시면 도움이 될 수 있습니다:
- npm Error 해결 방법
- React 프로젝트 생성 중 에러 해결
저는 질문자님의 이해를 돕고자 지식공유자님의 기존 답변을 참고하여 유사한 답변 링크를 추천해드리고 있습니다.
현재 베타 기능으로 답변이 만족스럽지 않을 수 있는 점 양해 부탁드립니다. 🙏
추가적으로 궁금한 점이 있으시면, 이어서 질문해 주세요. 곧 지식공유자께서 답변해 주실 것입니다.
오타?
0
30
1
뭐하나 여쭤봐도 될까요?
0
70
1
안녕하세요 질문이 있습니다.
0
56
2
질문 : 삭제 버튼 아규먼트 (id)
0
50
1
Tailwind 버전 확인
0
63
1
align-items 정렬
0
50
2
vite 명령어로 프로젝트를 만들었습니다. (vscode)
0
79
1
31. 객체 업데이트 하기 - 10:15 질문
1
56
2
강의교안, 내용 인용해서 블로그 글 작성
1
80
2
이미지가 출력되지 않아요
1
76
2
강의와 만들어진 코드가 달라요
0
76
3
AI와 CSS 라이브러리의 궁합
0
97
1
onClick 이벤트에 함수 넘길 때
0
68
1
린캔버스 기능 구현은 왜 못하나요.... 구현하고 싶습니다...
0
101
1
notes 없음 읽기 오류
0
72
1
Object.assign 문법
0
64
1
react-router 전혀 기능 안함
0
54
1
react-router-dom@6.25.1
0
47
1
React Router 최신 스펙
0
209
1
Immer 에서 filter, map 사용
0
55
1
vite 설치에 대해 질문있습니다.
0
76
2
라이브러리 버전 일치 이슈
0
77
1
"Enter 키 발생 시 항목 추가" 부분에서 공백이 포함되면 한 줄이 더 입력됩니다
0
51
2
TotalCounter을 작성할때
0
67
2





