LJC.LOG
December 10, 2024

react native 설치 중 Error: spawn npx ENOENT 에러 해결방법

1) 에러내용

npx react-native init 프로젝트 명 명령어로 react native 프로젝트를 생성할 때 아래와 같은 에러가 발생

2) 해결방법

해당에러에 대해서 해결방법을 찾아보니, 환경변수 설정이 안된 경우 발생되는 경우도 있는 것으로 보이는데

나에게는 해당되지 않았다.

결론적으로 해결방법은 node.js 최신버전으로 재설치 및 모듈을 다시 설치하였다.

node.js 22버전으로 재설치 후 npm과 npx 버전이 나오는지 확인한다.

npm -v

npx -v

2-1) 기존에 설치된 react-native-cli 제거

> npm uninstall -g react-native-cli

2-2) react-native-community/cli 설치

> npm install -g @react-native-community/cli

2-3) 프로젝트 생성

> npx @react-native-community/cli init 프로젝트명

와.. 2시간의 삽질끝에 드디어 성공...

photo

Related Posts