React Native개발을 하다가 패키지를 업데이트 했는데,
발생한 이슈
console.error: React Native version mismatch.
JavaScript version: 0.62.2
Native version: 0.63.2
Make sure that you have rebuilt the native code. If the problem persists try clearing the Watchman and packager caches with `watchman watch-del-all && react-native start --reset-cache`.
construct
[native code]:0
_construct
construct.js:19:9
Wrapper
wrapNativeSuper.js:26:22
construct
[native code]:0
_createSuperInternal
AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:29563:321
SyntheticError
AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:29581:31
reactConsoleErrorHandler
ExceptionsManager.js:187:33
checkVersions
ReactNativeVersionCheck.js:31:4
<global>
checkNativeVersion.js:18
loadModuleImplementation
require.js:321:11
<global>
InitializeCore.js:43:9
loadModuleImplementation
require.js:321:11
guardedLoadModule
require.js:201:44
global code
AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:186445:3이러한 이슈가 발생하였다.
해결 과정
이 문제를 해결하려고 온갖 노력을 하였다.
처음에 모든 터미널을 종료 후 실행해보라고 하여 재부팅까지 해보았지만, 해결되지 않았다.
그 다음 --reset-cache를 이용하여, 문제를 해결해보려 하였지만, 이 또한 해결되지 않았다.
해결 방법
stackoverflow에서 글을 참고한 결과,
npx react-native upgradenpm install -g react-native-cli이와 같은 명령어를 사용한 결과 정상적으로 동작하였다.