$ npx create-react-app [프로젝트 명] --template typescript

or

$ npx create-react-app [프로젝트 명] --typescript

 

오랜만에 리액트 프로젝트를 생성하려고하니 다음과 같은 메시지를 확인했다.

 

$ create-react-app basic-react

You are running `create-react-app` 4.0.3, which is behind the latest release (5.0.0).

We no longer support global installation of Create React App.

Please remove any global installs with one of the following commands:
- npm uninstall -g create-react-app
- yarn global remove create-react-app

The latest instructions for creating a new app can be found here:
https://create-react-app.dev/docs/getting-started/

 

Getting Started | Create React App

Create React App is an officially supported way to create single-page React

create-react-app.dev

 

해결방법

npm uninstall -g create-react-app

npm add create-react-app

npx create-react-app [프로젝트명]

리액트 프로젝트 생성하려고 하는데 노드버젼이낮아서 발생

 

You are running Node 12.18.0.
Create React App requires Node 14 or higher.
Please update your version of Node.

 

해결방법(win.ver)

 

1. 설치된 노드버젼 확인

node -v

 

2. 최신 버젼 업데이트시 발생할 수 있는 오류를 방지하기 위해 npm에 남아있는 캐시 삭제

npm cache clean -f

 

 

3. npm 재설치

npm install -g n

 

[실제 아래와 같은 에러 발생하면서 실행안됨]

 

npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for n@8.0.2: wanted {"os":"!win32","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! notsup Valid OS:    !win32
npm ERR! notsup Valid Arch:  any
npm ERR! notsup Actual OS:   win32
npm ERR! notsup Actual Arch: x64

 

=> win 버젼은 아래 홈페이지에서 파일받아서 덮어쓸 것

=> 공식홈페이지에 LTS 버젼을 다운

https://nodejs.org/ko/

 

Node.js

Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine.

nodejs.org

 

설치 완료 후, node -v 확인해보면 업그레이드 되었음을 확인할 수 있다.

+ Recent posts