react native 踩坑之路一

1.环境解说:react native 0.59.2

2.安装后运行 :react-native run-android 报错 启动首页response 500错误

react native 踩坑之路一_第1张图片

3.解决办法

A.重新安装node_modle 无效

B.重新编译项目  无效

C.以及其他办法. .etc

=====> 不报希望的尝试了清除缓存后再次运行,居然成功了

{
  "name": "myDemo",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest",
    "lint": "eslint .",
    "bStart":"react-native start",
    "runAdn":"run-android",
    "cache":"react-native start --reset-cache",//URL报500后 清除缓存在运行bApk即可
    "bApk": "react-native run-android" //debug包编译命令
    
  },
  "dependencies": {
    "react": "16.8.3",
    "react-native": "0.59.2"
  },
  "devDependencies": {
    "@babel/core": "^7.4.0",
    "@babel/runtime": "^7.4.2",
    "@react-native-community/eslint-config": "^0.0.3",
    "babel-jest": "^24.5.0",
    "eslint": "^5.15.3",
    "jest": "^24.5.0",
    "metro-react-native-babel-preset": "^0.53.1",
    "react-test-renderer": "16.8.3"
  },
  "jest": {
    "preset": "react-native"
  }
}

 

 

 

 

 

你可能感兴趣的:(React,Native)