I followed following link to get started with react-native
Getting started with react native
I tried to create native app without expo so i as per documentation i followed following command
npm install -g react-native-cli
react-native init AwesomeProject
After run android command
react-native run-android
It gave me following error on emulator
So i used start command to run metro server
react-native start
This command gave me another error in console
A similar question was asked here may be this solution might work for you cause i applied and it worked
yes i am also facing this issues. actually Node.js Recommended For Most Users is version 10.16.3 LTS. Using below choco command will install Latest version of 12.11.0. choco install -y nodejs.install python2 jdk8
I downgrade Node version from 12.11.0 to 10.16.3 LTS and it worked for me.
Its compatibility issue of Nodejs I uninstalled my Node(12.11) and installed Node(10) stable version and it worked perfectly.
The solution is to change the
blacklist.js
file in modulemetro-config
files as answered above. But each time you runnpm/yarn install
you will have to change it again.So I came up with a solution that will save you time form going to the file and changing it each time:
I used a library that edit files using JavaScript:
Create a file at the same level as
node_module
folder name it:metro-fix.js
per example.Copy paste this script in it:
npm install
just run:See Replace-in-file docs.
close Commands prompt and metro bundler,do it again
yeah, just shift to Node version 10 and it will work.
it works...... :)