[React Native] npm install 시 ENOENT 에러 해결

Siwon Yoo·2021년 11월 25일
4

오늘 맞이한 에러는~ 바로바로~!~!

ENOENT 에러

ENOENT는 Error NO ENTry의 약어라고 한다.
패키지를 설치하려고 할 때마다 발생하는 에러인데,
This is related to npm not being able to find a file이라고 적혀 있듯이
설치하려고 하는 경로를 npm이 잘 못 찾아주는 것 같다ㅜ

npm ERR! code ENOENT
npm ERR! syscall rename
npm ERR! path C:\Users\Siwon\Desktop\RNex\Cmoovies\node_modules\styled-components
npm ERR! dest C:\Users\Siwon\Desktop\RNex\Cmoovies\node_modules\.styled-components.DELETE
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\Siwon\Desktop\RNex\Cmoovies\node_modules\styled-components' 
-> 'C:\Users\Siwon\Desktop\RNex\Cmoovies\node_modules\.styled-components.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Siwon\AppData\Roaming\npm-cache\_logs\2021-11-25T02_09_05_468Z-debug.log

npm ERR! code ENOENT
npm ERR! syscall rename
npm ERR! path C:\Users\Siwon\Desktop\RNex\Cmoovies\node_modules\expo-blur
npm ERR! dest C:\Users\Siwon\Desktop\RNex\Cmoovies\node_modules\.expo-blur.DELETE
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\Siwon\Desktop\RNex\Cmoovies\node_modules\expo-blur' -> 'C:\Users\Siwon\Desktop\RNex\Cmoovies\node_modules\.expo-blur.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Siwon\AppData\Roaming\npm-cache\_logs\2021-11-25T04_56_00_921Z-debug.log

해결

구글링을 통해 여러 방법을 찾아 보았지만, 내 경우는 안드로이드 빌드 파일을 삭제해 주니 문제가 해결되었다.
1. 터미널에서 루트 디렉토리 내에 있는 android 디렉토리로 접근.
C:\Users\Root Directory > cd android
2. 빌드 파일 삭제
C:\Users\Root Directory\android > gradlew clean
cd android, gradlew clean를 하면

이렇게 알아서 막 지운다.

그리고 cd ..로 루트 디렉토리로 이동해 다시 설치하면,

정상적으로 설치 완료!
아무래도 안드로이드로 빌드하는 과정에서 이름이 중복되는 파일이 생겼나보다.

profile
세상은 넓고 배울 건 언제나 많다😃

0개의 댓글