
react 프로젝트를 만들기 위해 아래 명령어 입력
$ npx create-react-app .
입력시 아래와 같은 에러 발생
npm error code EEXIST
npm error syscall mkdir
npm error path /Users/{유저명}/.npm/_cacache/content-v2/sha512/6c
npm error errno EEXIST
npm error Invalid response body while trying to fetch https://registry.npmjs.org/typescript: EACCES: permission denied, mkdir '/Users/greencar/.npm/_cacache/content-v2/sha512/6c'
npm error File exists: /Users/{유저명}/.npm/_cacache/content-v2/sha512/6c
npm error Remove the existing file and try again, or run npm
npm error with --force to overwrite files recklessly.
npm error A complete log of this run can be found in: /Users/{유저명}/.npm/_logs/2025-09-26T05_31_22_425Z-debug-0.log
node.js를 삭제하고 설치해 보았지만 동일하게 에러
아래 명령어로 캐시를 삭제 시도
$ npm cache verify
위 명령어를 입력하면 아래와 같이 노출되는데,
'chown'은 'change owner'의 약자이다. 즉 해당 디렉토리 안에 있는 모든 파일에 대한 소유 권한을 그룹 ID 20, 사용자 ID 501에 할당한다는 의미였다.
npm error code EACCES
npm error syscall open
npm error path /Users/{유저명}/.npm/_cacache/index-v5/02/f5/edc1bbb9c74c3776beb4a96bd21991b46bb40507edd7be8d7c966577dcb5
npm error errno -13
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/{유저명}/.npm"
npm error A complete log of this run can be found in: /Users/{유저명}/.npm/_logs/2025-09-26T06_36_08_194Z-debug-0.log
이렇게 알려준 명령어 입력
$ sudo chown -R 501:20 "/Users/{유저명}/.npm
다시 "npx create-react-app ."을 입력하니 정상적으로 react app이 생서되었다.
'JavaScript FrontEnd > React' 카테고리의 다른 글
| [React] 리액트 - 컴포넌트 생명 주기 (Component Life Cycle) (0) | 2021.12.13 |
|---|---|
| [React] 리액트 - 함수형 컴포넌트 (Functional Component) (0) | 2021.12.13 |
| [React] 리액트 - 데이터가 변경하는 리액트 앱 만들기 예제 (0) | 2021.12.13 |
| [React] 리액트 - 배열 내장 함수 map을 통한 Component 반복 (0) | 2021.12.13 |
| [React] 리액트 - 이벤트 처리하기 (0) | 2021.12.13 |
| [React] 리액트 - state 사용하기 (0) | 2021.12.13 |
| [React] 리액트 - props 사용하기 (0) | 2021.12.13 |
| [REACT] 리액트 - 리액트의 주요 특징 (0) | 2021.12.13 |
