이롭게 현명하게

[E-LOG] yarn create next-app@latest 오류 본문

T-LOG/E-LOG

[E-LOG] yarn create next-app@latest 오류

dev_y.h 2025. 10. 21. 18:16
728x90
반응형

yarn create next-app@latest 오류


목차

오류 내용

원인

해결방법


 


[오류 내용]

<상황>

사이드 프로젝트가 next.js 15에서 진행하고 있다.

라이브러리 사용법이 이해가 가지 않아 라이브러리를 익히기 위해 동일한 환경에서 학습해 보려고 했다.

그래서 next.js 공식문서 보면서 프로젝트 설치를 진행 중이었다.

next.js 공식문서

 

yarn create next-app@latest

명령어를 입력하였다.

 

<오류>

오류

 

하지만 무슨 이유에서인지 오류가 발생하면서 설치가 되지 않는 상황이 발생했다.

C:\Users\samsung\Desktop\Project\Front-Study\Zustand>yarn create next-app@latest 
yarn create v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "create-next-app@15.5.5" with binaries:
      - create-next-app
'C:\Users\samsung\AppData\Local\Yarn\bin\create-next-app@latest'은(는) 내부 또는 외부 명령, 실행할 수 있는 프로그램, 또는
배치 파일이 아닙니다.
error Command failed.
Arguments:
Directory: C:\Users\samsung\Desktop\Project\Front-Study\Zustand
Output:

info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.

 

 


[원인]

<문제 원인>

yarn create next-app@latest

yarn create 명령이 @latest 같은 버전 지정과 잘 호환되지 않아서 생긴 것이다.

yarn이 create-next-app@latest 라는 파일을 실행하려고 하지만 실제로는 create-next-app 명령만 존재한다.

즉, yarn이 실행 파일을 찾지 못해 발생한 것이었다.


[해결 방법]

해결 방법으로는 3가지 방법이 있다.

  1. @latest 빼고 실행(가장 간단)
  2. npx로 실행
  3. yarn 버전업그레이드

 

나는 간단하게 @latest를 빼고 실행했다.

https://nextjs-ko.org/docs/app/api-reference/create-next-app

 

create-next-app – Nextjs 한글 문서

Create Next.js apps in one command with create-next-app.

nextjs-ko.org

 

yarn create next-app

설치가 성공적으로 이루어졌다.

설치 중
성공

 

2. npx 로 실행

npx create-next-app@latest

3. yarn 버전 업그레이드

npm install -g yarn
yarn set version stable
yarn create next-app

 


잘못된 정보는 댓글에 남겨주시면 감사하겠습니다!☺️

댓글과 좋아요는 큰 힘이 됩니다!

728x90
반응형
Comments