Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

the development server returned response error code 500 - react native - ./configs/main

I got this error when i tried to make hello-world sample:
react-native init hello_world cd hello_world react-native run-android

Even when I ran:
npm install -g react-native-git-upgrade react-native-git-upgrade
I got same error on commend line console. enter image description here

I've searched and tried many solutions but it doesn't seem to work: Example:
* upgrade react-native
* using watchman watchman watch-del-all
* remove node_modules
* clean cache npm cache cleanor npm start -- --reset-cache

Operation: Window 8
react-native-cli: 2.0.1
react-native: 0.44.2 ( tried 0.47.1 too )
Android: Simulator Nexus5X

Thank you all in advance!

like image 263
gaback Avatar asked May 05 '26 09:05

gaback


2 Answers

Delete babel-preset-react-native folder inside node_modules and then install older version 2.1.0 of this library with npm install [email protected] --save-dev.

like image 152
Paras Watts Avatar answered May 08 '26 01:05

Paras Watts


In case if someone is using react-native: 0.57.1 or the latest one,babel-preset-react-native has been replaced by metro-react-native-babel-preset. if you still get 500 error while connecting to the device do the below step and I guess things will be fine

npm add @babel/runtime
npm install
like image 29
MRX Avatar answered May 07 '26 23:05

MRX