카테고리 없음
[에러 해결] React Native on Android: Cannot run program "node": error=2, No such file or directory
딸기케잌🍓
2022. 2. 27. 00:28
맥북으로 IOS 시뮬레이터 에러를 해결하고 안드로이드 에뮬레이터를 실행해보려고 하니 또 에러가 난다..
에러내용
:ReactNative:Running ‘[node, -e, console.log(require(‘react-native/cli’).bin);]’ command failed.
- Where:
Script ‘/Users/…/Desktop/…/node_modules/@react-native-community/cli-platform-android/native_modules.gradle’ line: 154
- What went wrong:
A problem occurred evaluating script.
> Cannot run program “node”: error=2, No such file or directory
Caused by: java.io.IOException: Cannot run program “node”: error=2, No such file or directory
에러원인
nvm으로 설치된 노드의 경로를 안드로이드 스튜디오에서 찾지 못해서 나는 에러이다.
Solution
nvm으로 설치된 노드를 /usr/local/bin/node로 연결해준다.
sudo ln -s "$(which node)" /usr/local/bin/node