⦁ reactApp설치하는 법
-node.js 설치한다 (https://nodejs.org/ko/download/)
-vscode의 터미널에 해당 폴더 경로에 react install 해주어야 함.
(https://devbirdfeet.tistory.com/3)
npm install -g create-react-app 이걸로 설치함
터미널에 npm install -g create-react-app 이거 입력함
PS C:\Users\sagoMungcci\Desktop\react-project> npm install -g create-react-app
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
added 67 packages in 3s
5 packages are looking for funding
run `npm fund` for details
그후 npx create-react-app react-app(폴더명)
입력하면 폴더에 해당 react 패키지가 생성됨
PS C:\Users\sagoMungcci\Desktop\react-project> npx create-react-app react-app
Creating a new React app in C:\Users\sagoMungcci\Desktop\react-project\react-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
added 1439 packages in 1m
241 packages are looking for funding
run `npm fund` for details
Git repo not initialized Error: Command failed: git --version
at checkExecSyncError (node:child_process:885:11)
at execSync (node:child_process:957:15)
at tryGitInit (C:\Users\sagoMungcci\Desktop\react-project\react-app\node_modules\react-scripts\scripts\init.js:46:5)
at module.exports (C:\Users\sagoMungcci\Desktop\react-project\react-app\node_modules\react-scripts\scripts\init.js:276:7)
at [eval]:3:14
at Script.runInThisContext (node:vm:123:12)
at Object.runInThisContext (node:vm:299:38)
at node:internal/process/execution:79:19
at [eval]-wrapper:6:22 {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 11228,
stdout: null,
stderr: null
}
Installing template dependencies using npm...
added 69 packages, and changed 1 package in 7s
245 packages are looking for funding
run `npm fund` for details
Removing template package using npm...
removed 1 package, and audited 1508 packages in 3s
245 packages are looking for funding
run `npm fund` for details
6 high severity vulnerabilities
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
Success! Created react-app at C:\Users\함주형\Desktop\react-project\react-app
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 can’t go back!
We suggest that you begin by typing:
cd react-app
npm start
Happy hacking!
- 중요!
- 터미널에서 npm run start 할때 react 패키지가 있는 폴더의 경로에 가서 npm run start 해야한다.
- 상위폴더 이동 명령어는 cd..이고
- 해당 폴더 경로 이동은 cd 폴더명이다.