Thief of Wealth
Published 2020. 7. 29. 17:53
CRA error... 개발/Web Programming

정상적으로 npx create-react-app my-app을 실행했는데 

 

폴더안에 src, public 폴더가 없고 에러로 template을 불러올 수 없다고 뜨고, 

 

A template was not provided. This is likely because you're using an outdated version of create-react-app. Please note that global installs of create-react-app are no longer supported

 

 

겨우겨우 public, src 폴더를 생성하니까 1부터 9번까지의 방법이 나오면서 webpack version때문에 yarn start를 할 수 없다고 뜬다.

 

이때 해결방법은

 

create-react-app과 관련된 모든 데이터를 삭제해주고 재설치 하는 것이다.

 

 

1. which create-react-app

으로 위치를 파악해서

rm -rf 위치

으로 다 삭제해준다.

이미 없다고 뜬다면  

 

맥 같은 경우는 /usr/bin 이랑 /Users/me/node)mudules 폴더에서 create-react-app 폴더를 직접 찾아서 싹 다 제거해준다.

윈도우인 경우는

%appdata%npm
(== C:\Users\{ npm이 설치된사용자 계정}\AppData\Roaming\npm)

위 디렉토리 내의 구성요소들을 모두 삭제해준다.

C:\Users\{사용자 계정}\AppData\Local\Yarn

 

2. npm uninstall -g create-react-app

yarn remove global create-react-app 을 실행해서 지워준다.

 

3. 다시 npx create-react-app my-app 을 해주면 폴더가 다 생성되고 yarn start로 실행도 잘된다.

 

 

npm uninstall -g create-react-app

yarn remove global create-react-app

명령어로 삭제한줄 알았는데 아니라서 많이 삽질을 했던 에러였다.

 

 

profile on loading

Loading...