[React Native 日常错误记录] 报错 React N
2019-05-08 本文已影响0人
Buddha_like
11674896-d5c89ed127b19a76.png
解法一:
方法:将package.json文件内的reactnative版本改成与提示的JavaScript版本一致,
终端输入命令行 npm install react-native@0.50.1。
如果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服务器获取代码与本机服务器冲突。