섭섭한 개발일지

[react] ts 프로젝트 만들기 본문

CS/Web

[react] ts 프로젝트 만들기

Seop 2025. 6. 22. 23:46

react 앱을 생성하며 . 은 현재 폴더에 만드는 것

 npx create-react-app .

 

 

 

Creating a new React app in /Users/gimtaeseob/GIT/ts_learning/section11.

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

npm error code EACCES
npm error syscall mkdir
npm error path /Users/gimtaeseob/.npm/_cacache/index-v5/92/81
npm error errno EACCES
npm error
npm error Your cache folder contains root-owned files, due to a bug in
npm error previous versions of npm which has since been addressed.
npm error
npm error To permanently fix this problem, please run:
npm error   sudo chown -R 501:20 "/Users/gimtaeseob/.npm"
npm error A complete log of this run can be found in: /Users/gimtaeseob/.npm/_logs/2025-06-22T14_37_55_442Z-debug-0.log

Aborting installation.
  npm install --no-audit --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.

Deleting generated file... package.json
Deleting section11/ from /Users/gimtaeseob/GIT/ts_learning
Done.

 

 

이전 학습 과정에서 유저 정보를 변경함으로 인해 권한 문제가 발생하여 아래의 명령어 추가 입력

sudo chown -R $(id -u):$(id -g) ~/.npm

 

 

리액트 앱 생성 후

ts 적용

npm i @types/node @types/react @types/react-dom @types/jest

 

 

 

한방에 만드는 법

npx create-react-app . --template typescript

'CS > Web' 카테고리의 다른 글

OSI 7계층 - 전송 계층  (0) 2024.05.02
인터넷 프로토콜 - Stateful, Stateless  (0) 2024.05.01
OSI 7계층 - 네트워크 계층  (0) 2024.04.30
OSI 7계층 - 데이터링크 계층  (0) 2024.04.29
OSI 7계층 기능 - 물리계층  (0) 2024.04.28
Comments