본문 바로가기

ERRORMESSAGE

[React] 리엑트 파일 생성 에러(npx create-react-app 설치 에러)

728x90
$ npx create-react-app start-react

start-react라는 파일을 생성하려는데 자꾸 이러한 에러가 날 때 두가지 방법이 있다.

npm ERR! code ENOENT
npm ERR! syscall lstat
npm ERR! path C:\Users\aaa\AppData\Roaming\npm
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, lstat 'C:\Users\kkddy\AppData\Roaming\npm'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\aaa\AppData\Local\npm-cache\_logs\2023-07-14T05_01_33_804Z-debug-0.log

 

 

방법 1. npm 초기설정

$ npm init
$ npm install finalhandler

 

 

방법 2.  create-react-app 부터 지우기

 

1) 첫번째, "$npm -g ls" 명렁어로 지워졌는지 확인

$ npm uninstall -g create-react-app

2) 두번째, 다시 create-react-app 설치

$ npm install -g create-react-app

3)세번째, 파일 생성

$ npx create-react-app start-react

4) 파일 생성 후 이러한 문자 확인

cd begin-react
  npm start
Happy hacking!
728x90