윈도우즈를 통해 React 환경 구축

15066 단어 React

개요


리액션을 만지고 싶은 자신의 업무 이력서.

Node.js 설치


공식.에서 설치 프로그램 다운로드 및 설치
명령 프롬프트에서 확인(이 글은 PowerShell)
예를 들어 다음 버전 정보가 나타날지 확인합니다
> node -v
v10.15.0
> npm -v
6.4.1

create-react-app 설치

npm install -g create-react-app
> npm install -g create-react-app
C:\Program Files\nodejs\create-react-app -> C:\Program Files\nodejs\node_modules\create-react-app\index.js
+ create-react-app@2.1.8
added 63 packages from 20 contributors in 10.087s

실행


디렉토리 만들기
디렉토리를 지정하고 명령을 실행합니다.
create-react-app <ディレクトリ名>
※ 이름에 대문자 포함 NG
Could not create a project called "HelloWorld" because of npm naming restrictions:
  *  name can no longer contain capital letters
> create-react-app helloworld

Creating a new React app in C:\helloworld.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...

+ react-dom@16.8.6
+ react@16.8.6
+ react-scripts@2.1.8
added 1851 packages from 718 contributors and audited 36248 packages in 153.576s
found 68 vulnerabilities (63 low, 5 high)
  run `npm audit fix` to fix them, or `npm audit` for details

Success! Created helloworld at C:\helloworld
Inside that directory, you can run several commands:

  npm start
    Starts the development server.

  npm run build
    Bundles the app into static files for production.

  npm test
    Starts the test runner.

  npm run eject
    Removes this tool and copies build dependencies, configuration files
    and scripts into the app directory. If you do this, you cant go back!

We suggest that you begin by typing:

  cd helloworld
  npm start

Happy hacking!
지정된 디렉토리로 이동
다음 명령 시작
npm start
> npm start

> helloworld@0.1.0 start C:\helloworld
> react-scripts start
Starting the development server...
경고를 보내다

브라우저가 시작되고 다음 페이지가 열립니다.

명령 프롬프트는 이런 느낌이에요.

Compiled successfully!

You can now view helloworld in the browser.

  Local:            http://localhost:3000/
  On Your Network:  http://***.***.**.***:3000/

Note that the development build is not optimized.
To create a production build, use npm run build.

참고 자료


Windows+VScode에서 React 개발 환경 구축 - Qita
https://qiita.com/willow-c/items/ad5c1a15d8b32d75d927

좋은 웹페이지 즐겨찾기