$ yarn create react-app app1
명령어로 프로젝트를 생성할 경우 .yarn 폴더가 생성되지 않은 경우가 있습니다.
그럴 경우에는 yarn 버전을 다시 설정해 주면 해결됩니다.
❯ yarn -v
1.22.21
❯ yarn set version stable
➤ YN0000: Retrieving https://repo.yarnpkg.com/4.0.2/packages/yarnpkg-cli/bin/yarn.js
➤ YN0000: Saving the new release in .yarn/releases/yarn-4.0.2.cjs
➤ YN0000: Done in 0s 225ms
❯
❯ yarn -v
4.0.2
> ls
app1/
❯ rm -rf app
❯ yarn create react-app app1
➤ YN0000: · Yarn 4.0.2
➤ YN0000: ┌ Resolution step
➤ YN0085: │ + create-react-app@npm:5.0.1, ansi-styles@npm:4.3.0, and 65 more.
➤ YN0000: └ Completed in 1s 451ms
➤ YN0000: ┌ Fetch step
➤ YN0013: │ 67 packages were added to the project (+ 3.02 MiB).
➤ YN0000: └ Completed in 0s 617ms
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: · Done in 2s 126ms
Creating a new React app in /home/yunix/work/programming/react/app1.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
➤ YN0000: · Yarn 4.0.2
➤ YN0000: ┌ Resolution step
➤ YN0085: │ + cra-template@npm:1.2.0, react-dom@npm:18.2.0, and 1272 more.
➤ YN0000: └ Completed in 5s 606ms
➤ YN0000: ┌ Fetch step
➤ YN0013: │ 1227 packages were added to the project (+ 139.48 MiB).
➤ YN0000: └ Completed in 4s 274ms
➤ YN0000: ┌ Link step
➤ YN0000: │ ESM support for PnP uses the experimental loader API and is therefore experimental
➤ YN0007: │ core-js@npm:3.35.0 must be built because it never has been before or the last one failed
➤ YN0007: │ core-js-pure@npm:3.35.0 must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 1s 573ms
➤ YN0000: · Done with warnings in 11s 609ms
Initialized a git repository.
Installing template dependencies using yarnpkg...
➤ YN0000: · Yarn 4.0.2
➤ YN0000: ┌ Resolution step
➤ YN0085: │ + @testing-library/jest-dom@npm:5.17.0, and 38 more.
➤ YN0000: └ Completed in 2s 535ms
➤ YN0000: ┌ Post-resolution validation
➤ YN0002: │ basic@workspace:. doesn't provide @testing-library/dom (p7b4a6), requested by @testing-library/user-event.
➤ YN0086: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code.
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0013: │ 39 packages were added to the project (+ 10.77 MiB).
➤ YN0000: └ Completed in 1s 28ms
➤ YN0000: ┌ Link step
➤ YN0000: │ ESM support for PnP uses the experimental loader API and is therefore experimental
➤ YN0000: └ Completed
➤ YN0000: · Done with warnings in 3s 844ms
Removing template package using yarnpkg...
➤ YN0000: · Yarn 4.0.2
➤ YN0000: ┌ Resolution step
➤ YN0085: │ - cra-template@npm:1.2.0
➤ YN0000: └ Completed
➤ YN0000: ┌ Post-resolution validation
➤ YN0002: │ basic@workspace:. doesn't provide @testing-library/dom (p7b4a6), requested by @testing-library/user-event.
➤ YN0086: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code.
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0s 446ms
➤ YN0000: ┌ Link step
➤ YN0000: │ ESM support for PnP uses the experimental loader API and is therefore experimental
➤ YN0000: └ Completed
➤ YN0000: · Done with warnings in 0s 808ms
Created git commit.
Success! Created basic at /home/yunix/work/programming/react/app1
Inside that directory, you can run several commands:
yarn start
Starts the development server.
yarn build
Bundles the app into static files for production.
yarn test
Starts the test runner.
yarn 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 basic
yarn start
Happy hacking!
>
프로젝트 폴더로 이동해서 생성 폴더 및 파일을 확인합니다.
❯ cd app1
❯ tree -a -L 2
.
├── .git
│ ├── COMMIT_EDITMSG
│ ├── FETCH_HEAD
│ ├── HEAD
│ ├── branches
│ ├── config
│ ├── description
│ ├── hooks
│ ├── index
│ ├── info
│ ├── logs
│ ├── objects
│ └── refs
├── .gitignore
├── .pnp.cjs
├── .pnp.loader.mjs
├── .yarn
│ ├── install-state.gz
│ └── unplugged
├── README.md
├── package.json
├── public
│ ├── favicon.ico
│ ├── index.html
│ ├── logo192.png
│ ├── logo512.png
│ ├── manifest.json
│ └── robots.txt
├── src
│ ├── App.css
│ ├── App.js
│ ├── App.test.js
│ ├── index.css
│ ├── index.js
│ ├── logo.svg
│ ├── reportWebVitals.js
│ └── setupTests.js
└── yarn.lock
개발모드로 프로젝트를 실행합니다.
> yarn start
Compiled successfully!
You can now view basic in the browser.
Local: http://localhost:3000
On Your Network: http://192.168.122.26:3000
Note that the development build is not optimized.
To create a production build, use yarn build.
webpack compiled successfully
'FRONTEND > React' 카테고리의 다른 글
Zustand로 상태관리 하기 (0) | 2024.05.28 |
---|---|
오류! yarn update(upgrade) (0) | 2024.01.03 |
오류! 설치 후 프로젝트에서 코드 수정 시 오류 (0) | 2023.03.25 |
yarn 설치 시 오류 (0) | 2022.12.20 |