React Native Version Mismatch错误解决

错误详情

React Native Version Mismatch错误解决方法:

解法一:
方法:
将package.json文件内的react native版本改成与提示的JavaScript版本一致,npm install [email protected]。如果JS版本比较高,那么官网有react-native的更新方法,请查看react-native更新。
原因:
RN与JS版本不同造成的。

解法二:
方法:
Close all terminals and run build again.关闭所有终端并再次运行构建。
原因:
You may forgot to close nodejs terminal from another project, and they happen to have installed different react version.So the code fetch from nodejs server conflicts with native one.
您可能忘记从另一个项目关闭nodejs终端,他们碰巧安装了不同的反应版本。 因此,从nodejs服务器获取代码与本机服务器冲突。

解法三:
这种方法没试过,在github上面看见的,上面两种方法解决不了的试试这种方法吧~~github地址
open terminal inside your project folder
step1- sudo npm install -g react-native-git-upgrade
step2- react-native-git-upgrade
after this delete the two highlighted lines in manifest.xml for the conflict named '>>>then and >>>>after'
step3- watch-del-all && react-native start --reset-cache
now run your command react-native run-android

你可能感兴趣的:(React Native Version Mismatch错误解决)