I have followed react native official document and using React Native CLI Quickstart
https://facebook.github.io/react-native/docs/getting-started
npm --version
6.13.0
react-native --version
react-native-cli:2.0.1
react-native : 0.61.4
package.json
{
"name": "bg",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"react": "16.9.0",
"react-native": "0.61.4"
},
"devDependencies": {
"@babel/core": "^7.7.2",
"@babel/runtime": "^7.7.2",
"@react-native-community/eslint-config": "^0.0.5",
"babel-jest": "^24.9.0",
"eslint": "^6.6.0",
"jest": "^24.9.0",
"metro-react-native-babel-preset": "^0.57.0",
"react-test-renderer": "16.9.0"
},
"jest": {
"preset": "react-native"
}
}
when i run react-native start getting error
error Invalid regular expression: /(.__fixtures__.|node_modules[]react[ ]dist[].|website\node_modules.|heapCapture\bundle.js|.__tests__\ .)$/: Unterminated character class. Run CLI with --verbose flag for more detai ls. SyntaxError: Invalid regular expression: /(.__fixtures__.|node_modules[\ ]react[]dist[].|website\node_modules.|heapCapture\bundle.js|.__t ests__.)$/: Unterminated character class at new RegExp () at blacklist (C:\Users\prakash lobo\bg\node_modules\metro-config\src\default s\blacklist.js:34:10) at getBlacklistRE (C:\Users\prakash lobo\bg\node_modules@react-native-commu nity\cli\build\tools\loadMetroConfig.js:66:59) at getDefaultConfig (C:\Users\prakash lobo\bg\node_modules@react-native-com munity\cli\build\tools\loadMetroConfig.js:82:20) at load (C:\Users\prakash lobo\bg\node_modules@react-native-community\cli\b uild\tools\loadMetroConfig.js:118:25) at Object.runServer [as func] (C:\Users\prakash lobo\bg\node_modules@react- native-community\cli\build\commands\server\runServer.js:82:58) at Command.handleAction (C:\Users\prakash lobo\bg\node_modules@react-native -community\cli\build\index.js:164:23) at Command.listener (C:\Users\prakash lobo\bg\node_modules\commander\index.j s:315:8) at Command.emit (events.js:210:5) at Command.parseArgs (C:\Users\prakash lobo\bg\node_modules\commander\index. js:651:12)
I have googled many solution but doesn't work at all . i am trying to fix this from last one month
Can you run react-native info and edit your issue to include these results under the React Native version: section?
[skip envinfo] alongside an explanation in your Environment: section.
C:\Users\vision\bg>react-native --version
react-native-cli: 2.0.1
react-native: 0.61.4
C:\Users\vision\bg>react-native info
info Fetching system and libraries information...
System:
OS: Windows 8.1
CPU: (4) x64 Intel(R) Core(TM) i3-2100 CPU @ 3.10GHz
Memory: 2.57 GB / 11.91 GB
Binaries:
Node: 13.0.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.17.3 - C:\Users\vision\AppData\Roamingnpmyarn.CMD
npm: 6.13.0 - C:\Program Files\nodejsnpm.CMD
IDEs:
Android Studio: Version 3.5.0.0 AI-191.8026.42.35.5791312
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.4 => 0.61.4
C:\Users\vision\bg>
As per stackoverflow comment i have uninstalled node js and installed with version
'
react-native info
info Fetching system and libraries information...
System:
OS: Windows 8.1
CPU: (4) x64 Intel(R) Core(TM) i3-2100 CPU @ 3.10GHz
Memory: 5.87 GB / 11.91 GB
Binaries:
Node: 12.13.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.17.3 - C:\Users\vision\AppData\Roamingnpmyarn.CMD
npm: 6.13.0 - C:\Program Files\nodejsnpm.CMD
IDEs:
Android Studio: Version 3.5.0.0 AI-191.8026.42.35.5791312
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.4 => 0.61.4
error still same
I have fixed this issue using following sollution
2.Even after changing node js .i was getting same error after that i have changed following code.
node_modules\metro-config\src\defaults\blacklist.js
var sharedBlacklist = [
/node_modules[/\]react[/\]dist[/\]./,
/website\/node_modules\/./,
/heapCapture\/bundle.js/,
/.\/__tests__\/./
];
replaced with this
var sharedBlacklist = [
/node_modules[\/\]react[\/\]dist[\/\]./,
/website\/node_modules\/./,
/heapCapture\/bundle.js/,
/.\/__tests__\/./
];
I am not closing this issue .since i need to know any other better solution since now i am changing code inside node modules.
i have this problem too!
please help!!!
System:
OS: Windows 10
CPU: (4) x64 Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz
Memory: 7.27 GB / 15.92 GB
Binaries:
Node: 12.13.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.19.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.12.0 - C:\Program Files\nodejs\npm.CMD
SDKs:
Android SDK:
API Levels: 28, 29
Build Tools: 28.0.3, 29.0.2
System Images: android-28 | Google APIs Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom_64
IDEs:
Android Studio: Version 3.5.0.0 AI-191.8026.42.35.5977832
npmPackages:
react: 16.8.6 => 16.8.6
react-native: 0.60.5 => 0.60.5
i did fixed this issue by downgrading node js to version 12.10.0 in windows
https://nodejs.org/dist/v12.10.0/node-v12.10.0-x64.msi
I am closing this issue because it does not contain the necessary environment info, and there has been no followup in a while.
If you found this thread after encountering the same issue in the latest release, please feel free to create a new issue with up-to-date information by clicking here.
I am closing this issue because it does not contain the necessary environment info, and there has been no followup in a while.
If you found this thread after encountering the same issue in the latest release, please feel free to create a new issue with up-to-date information by clicking here.
I am closing this issue because it does not contain the necessary environment info, and there has been no followup in a while.
If you found this thread after encountering the same issue in the latest release, please feel free to create a new issue with up-to-date information by clicking here.
Downgrading Node.js to version 12.10.0 in windows also fixed the problem for me.
https://nodejs.org/dist/v12.10.0/node-v12.10.0-x64.msi
Most helpful comment
i did fixed this issue by downgrading node js to version 12.10.0 in windows
https://nodejs.org/dist/v12.10.0/node-v12.10.0-x64.msi