开发服务器返回响应错误代码:反应本机0.56中的500

时间:2018-07-18 05:15:06

标签: android-studio

enter image description here

每次运行react-native run-android命令时,我都会不断遇到此问题。我试图降级版本,并完全重新安装了react native和npm。当我尝试清除守望者手表时,它会显示“无法识别守卫者”,而当我尝试运行rm -rf node_modules && npm install命令时,它会显示“无法识别rm”。

我正在使用Windows 10计算机,无法弄清楚。谢谢

1 个答案:

答案 0 :(得分:1)

这是react-native 0.56版本的错误,请尝试将版本降级为react-native0.55.4 以及babel依赖关系babel-preset-react-native:5.0.0到babel-preset-react-native:4.0.0。 运行此命令

npm install react-native@0.55.4

npm install babel-preset-react-native@4.0.0 对我有用

查看this链接以获取更多信息