-
[React Native_에러해결]Error: npm install exited with non-zero code: 1► React Native/개발일기 2024. 7. 15. 18:40반응형
react native 공식사이트에서 제공하는 명령어를 따라쓰고 새로운 expo CLI 프로젝트를 시작하려고 한다.
rn 공식링크: https://reactnative.dev/docs/environment-setup
Get Started with React Native · React Native
React Native allows developers who know React to create native apps. At the same time, native developers can use React Native to gain parity between native platforms by writing common features once.
reactnative.dev
공식문서에서는 아래의 명령어로 새로운 프로젝트를 생성하길 안내되어있다.
% npx create-expo-app@latest
하지만 아래와 같은 에러코드가 두둥 등장...
> npm install npm ERR! code EEXIST npm ERR! syscall mkdir npm ERR! path /Users/daramiya/.npm/_cacache/content-v2/sha512/76/2a npm ERR! errno EEXIST npm ERR! Invalid response body while trying to fetch https://registry.npmjs.org/react-native-screens: EACCES: permission denied, mkdir '/Users/daramiya/.npm/_cacache/content-v2/sha512/76/2a' npm ERR! File exists: /Users/daramiya/.npm/_cacache/content-v2/sha512/76/2a npm ERR! Remove the existing file and try again, or run npm npm ERR! with --force to overwrite files recklessly. npm ERR! A complete log of this run can be found in: /Users/daramiya/.npm/_logs/2024-07-15T09_28_15_508Z-debug-0.log Something went wrong installing JavaScript dependencies. Check your npm logs. Continuing to create the app. Error: npm install exited with non-zero code: 1
이유는?
권한허가와 같은 이유로 mac에서는 sudo를 명령어 앞에 넣어줘야한다.
에러난 프로젝트 파일은 삭제하고 다시, 아래와 같이 명령어로 실행해주면?
% sudo npx create-expo-app@latest
에러없이 설치완료!
개인적으로 개발시행착오를 겪으면서, 그런 경험들을 기록하기도하고, 모은정보들을 메모하며, 개인공부내용을 공유하는 게시물입니다. 친절한 조언과 다양한 의견 남겨주시고, 소통해주시는분들은 언제든지 환영합니다 :D
반응형'► React Native > 개발일기' 카테고리의 다른 글
[React Native]'안드로이드 앨법접근' 에러해결 (0) 2024.03.01 [React Native]'Xcode 시뮬레이터' 에러해결 (0) 2024.02.19 [React Native]'yarn android' 에러해결 (0) 2024.02.18 [React Native]'yarn android' 에러해결 (0) 2024.02.16 [React Native]'npx react-native run-android' 에러해결 (0) 2024.02.14