Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react-native start giving Invalid regular expression invalid error #26598

Closed
rohanpadwalkar opened this issue Sep 26, 2019 · 15 comments

Comments

@rohanpadwalkar
Copy link

commented Sep 26, 2019

React Native version: 0.61

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

Steps To Reproduce

Initial commands

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
image

enter image description here

So i used start command to run metro server

react-native start

This command gave me another error in console

Snack, code example, screenshot, or link to a repository:
image

Describe what you expected to happen:

Was expecting it to bypass command successfully and app to run on android

@rohanpadwalkar rohanpadwalkar added the Bug label Sep 26, 2019
@react-native-bot

This comment has been minimized.

Copy link
Collaborator

commented Sep 26, 2019

Thanks for submitting your issue. Can you take another look at your description and make sure the issue template has been filled in its entirety?

👉 Click here if you want to take another look at the Bug Report issue template.

@rohanpadwalkar

This comment has been minimized.

Copy link
Author

commented Sep 26, 2019

Node : v12.11.0
Npm: 6.11.3
Python: 2.7.16

@NyauIf

This comment has been minimized.

Copy link

commented Sep 27, 2019

Try to downgrade your Node version.
I've had the same issue after I upgraded from v12.8 => v12.11
After the downgrade it works again

@robstermarinho

This comment has been minimized.

Copy link

commented Sep 27, 2019

I downgrade Node version from 12.11.10 to the last stable version 10.16.3 LTS and it worked for me.
Thanks @NyauIf

@senthilkumar3282

This comment has been minimized.

Copy link

commented Sep 29, 2019

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.

@dibya-89

This comment has been minimized.

Copy link

commented Sep 30, 2019

Just downgrade the Node version it will work fine.
Best way to use https://github.com/nvm-sh/nvm
it helps to change the node version as required,

@friederbluemle

This comment has been minimized.

Copy link
Contributor

commented Oct 1, 2019

Same problem here. The following fixed it:

choco uninstall nodejs
choco install nodejs-lts
@Tiorock

This comment has been minimized.

Copy link

commented Oct 3, 2019

I downgrade Node version:
choco install -y nodejs.install --version 10.16.3 --force

@rohanpadwalkar

This comment has been minimized.

Copy link
Author

commented Oct 5, 2019

downgrading Node version worked for me.

Thanks everyone for help.

@halkliff

This comment has been minimized.

Copy link

commented Oct 7, 2019

They should be working on compatibility with node 12 though, the 10.16.3 LTS node is going to be replaced by Node 12 in Oct. 22, 2019.

@Coruscate5

This comment has been minimized.

Copy link

commented Oct 10, 2019

This issue should be reopened - following the documentation correctly leads to this failure, which means this is an open problem

@Coruscate5

This comment has been minimized.

Copy link

commented Oct 10, 2019

12.8 works for the time being - separate issue #26808 opened about the same problem

choco uninstall nodejs
choco install nodejs --version 12.8
@halkliff

This comment has been minimized.

Copy link

commented Oct 10, 2019

Actually, the version 12.10.0 is the latest that works. Still, the regex is incorrect nonetheless, and the newer versions of node won't tolerate it anymore, so it needs to be fixed.

It won't affect older versions, but surely will enable to be used in newer ones.

@momozizi

This comment has been minimized.

Copy link

commented Oct 12, 2019

i had same problem:
react-native start has error

Invalid regular expression

and after running react-native run-android my android device show me

unable to load script. make sure you...

then I tried to run choco unistall nodejd and run choco install nodejs-lts but react-native start has that error). so I run react-native info and result is:

info Fetching system and libraries information...
System:
OS: Windows 7
CPU: (8) x64 Intel(R) Core(TM) i7 CPU Q 740 @ 1.73GHz
Memory: 925.38 MB / 3.98 GB
Binaries:
Node: 12.11.1 - C:\Program Files\nodejs\node.EXE
npm: 6.11.3 - C:\Program Files\nodejs\npm.CMD
SDKs:
Android SDK:
API Levels: 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29
Build Tools: 25.0.0, 25.0.3, 26.0.0, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.
1, 28.0.2, 28.0.3, 29.0.1, 29.0.2
System Images: android-25 | Google APIs Intel x86 Atom, android-28 | Googl
e APIs Intel x86 Atom_64
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.2 => 0.61.2

I could not find my answer.

@efranelas

This comment has been minimized.

Copy link

commented Oct 13, 2019

Hello everyone. I had the same problem and this is what I did to solve it thanks to @NyauIf :

  1. Uninstalled version v12.11:
    choco uninstall nodejs.install
  2. Installed long-term support version v10.16.3:
    choco install nodejs-lts
  3. Started metro server:
    cd project && react-native start

Result:
React-native start
WhatsApp Image 2019-10-13 at 6 12 03 PM (1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.