React native project won't start windows - react-native

I have created a new React Native project using npx react-native ProjectName. When trying to start it with react run android, the Metro bundler starts but after a second it closes without displaying any error. This project was created with WebStorm that displayed in the project creation dialog that it used v2.0.1 of the cli.
I saw on github that this is a known bug of this version so I created another project manually with npx react-native#latest, but without any result.
Also, when trying to start the project with npm start I get this 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 details.
Any suggestions?

Related

Why metro builder is opening for new react native version in my old project? And facing Cannot find module 'expo-asset/tools/hashAssetFiles'

I recently initialized a new bare react-native project(initialized as version 0.70.6). And now I am facing this issue on my old react-native project.
And I am getting an error when the app runs. Error is error: src/res/images/play.png: Cannot find module 'expo-asset/tools/hashAssetFiles'
I am posting a solution to my question. Because if anyone is facing this without knowing the difference between npx react-native start vs react-native start
Solution: npx react-native start instead of react-native start
Explain: (Reference: https://stackoverflow.com/a/62067116/9877424)
There are currently two CLIs:
#react-native-community/cli – the one used directly by react-native. That makes it a transitive dependency of your project.
react-native-cli – an optional global convenience package, which is a proxy to #react-native-community/cli and global installation helper.
The global version is no longer recommended
npx executes either from a local node_modules/.bin, or from a central cache, installing any packages needed in order for to run.
When you run npx ... it picks up the cli package that is part of your project dependency

Not able to create React native app using React native version 0.69.0

I have tried to install app using
npx react-native init ProjectName
But it has just created package and node module files and not created Platform-specific folders like android and ios.
Try rerunning this command in another folder.
Check if there any errors in terminal where you ran that command

react-native app crashes while I want to run debugger-ui react-native-debbugger

I have started my application and install npm packages using npm install, then as usual I have installed debug version of the application using npx react-native run-android, then started the application with npx react-native start. The works fine until I want to use debugger-ui and debug my application using react-native-debugger or fb-flipper.
The problem occurs when pressing r in the terminal and choosing Debug from the modal that appears on the emulator screen.
This is the error that I'm facing with int he terminal:
And also this one in the React Native Debugger tab in the chrome console:
As I'm using the latest version of react-native-reanimated in this project and have followed the installation instructions in the documentation I have used this command for installing that:
npm install react-native-reanimated#next
I have been looking into documentation and after reading that really carefully I have just figured out that the react-native-reanimated#2 is not going to work with react-native-debugger and you can run debugger-ui the documentation recommended to use facebook flipper another amazing developer tool for react-native apps.

React Native missing script Android

I added a vector icon package in my React Native app. But After adding vector icon library I am trying to rebuild project using
**npm run android
react-native link**
But it's giving me an error
npm err missing script android react native
I have tried many solutions of updating package.json file from Github and I have tried to change the path of the environment but still same
I think you are using the wrong command to make debug build.
Following these steps:
install vector icon
link it from your project root directory using the command react-native link your_package_name
Use this command from your project root directory to make build react-native run-android

React Native not installing properly

I am familiar with React Native. I got a new macbook and I am trying to create a new file. However, when I run create-react-native-app [name of app] I am greeted with:
This command requires Expo CLI.
Do you want to install it globally [Y/n]?
When I pressed Y it created the file, however, in a complete file layout. It looked so odd and there were some files missing too.
Normally, when I run create-react-native-app it created the file without asking anything about expo. I am pretty confused. I'm pretty sure I have done wrong somewhere. Where and how I can get the traditional installation process back?
I also know that expo helps with testing. Since may I have been using npm start and npm run ios to test my apps on device and xcode simulation.
https://facebook.github.io/react-native/docs/getting-started I followed this.
New version out now and create react native app has been merged with expo CLI.
To avoid any bug use new version to create react apps, follow the command bellow which is also in the link given in your question.
expo init AwesomeProject
After installation you will be guided to start project with expo start.
cd AwesomeProject
expo start