React native bundling of js failed while running on android - javascript

In packager I am getting the following error when I am running the command
react-native run-android
The packager output is:
Loading dependency graph...
Bundling `index.js` [development, non-minified] ░░░░░░░░░░░░░░░░ 0.0% (0/1)Error: watch
ENOSPC
at _errnoException (util.js:1019:11)
at FSWatcher.start (fs.js:1383:19)
at Object.fs.watch (fs.js:1409:11)
at NodeWatcher.watchdir
Any help? thanks in advance.

Try to re run the project and clean the project, cd android and then gradlew clean, and I suggest to run react-native start first, then open a new terminal and run react-native run-android, also i found the troubleshooting case which is quite similar, https://facebook.github.io/react-native/docs/troubleshooting.html#unable-to-start-react-native-package-manager-on-linux hope that helps:)

I followed the steps:
Kill my node server process which is started on 8081 port.
Restarted my complete development environment
And then started my packager(react-native start) as super user.
then executed react-native run-android.
And it is running successfully now.

Related

how to run cloned/github remote react native app, err msg no android

NOTES: Im new in react native and i see there are so many approaches and with this error i thought the developer who built this app build it differently from what i learn so i don't understand why he didn't put the android folder
so i just joined a project and im going to run the apps in my pc by cloning it from github but when i try to npx react-native run-android it failed to run and the log is like this
error Android project not found. Are you sure this is a React Native project?
If your Android files are located in a non-standard location (e.g. not inside 'android' folder),
consider setting project.android.sourceDir option to point to a new location.
info Run CLI with --verbose flag for more details.
the folder structure is like this
The files show that the project is created with Expo. Specifically, you have a managed expo project.
npx react-native run-android would compile an android app from source, with Expo's managed workflow that's not needed. You will need the Expo Go App.
Expo also comes with its own commands to start the bundler. Instead of running npx react-native ... make use of the expo-cli running: npx expo start
However, in the package.json there is very likely a script called start. In that case, it's easier for you to run npm start.
After running this command the expo console opens. Here you can press a to open the app using expo go (or instructions on how to do so).
Alternatively, you can run npx expo run:android to start the expo go app on android yourself.
you are using an expo, there is a folder named .expo-shared, after
npm install
Try to run
npm start
or
expo start
or
npx expo start
something like this will appear:
https://imgur.com/U9I7Gf4
after that go to the terminal, open the emulator in you computer and click on the terminal and press 'a',

React Native Windows App Loading Error (80072f78)

I'm new to react and react-native, and am attempting to run the react-native-windows template project but have encountered an issue.
Error
App loads in a blank window with error banner Error 80072f78 downloading http://localhost:8081/index.bundle?platform=windows&dev=true&hot=false&inlineSourceMap=true
Image for reference
What I've Tried
I followed the instructions on the react-native-windows getting started docs
Namely:
npx react-native init <projectName> --template react-native#^0.63.2
cd projectName
npx react-native-windows-init --overwrite
npx react-native run-windows
The process will start another terminal window with the react logo. The application will build successfully, and will start in a new window. However, the original error is always present.
I've tried uninstalling and reinstalling all relevant programs. I've also tried building in both c# and c++, to no avail (adding the --language flag in the third step above).
Versions
react-native-windows: 0.63
react-native: 0.63.2
Windows SDK: 10.0.18362.0
node: 14.16.0
npm: 6.14.11
I couldn't find any issues like this online. If anyone has a suggestion, I would appreciate it. I'm more than happy to provide further info. Thanks!

How to resolve React Native package error issue and run the app in windows system

I'm completely new into react native. Trying to run an existing react native app after cloning it into my system => weather-app in windows but getting the below package error while trying to run the project in my windows system after doing npm start:
$ npm start
> Weather#0.1.0 start C:\Users\subho\Desktop\subhojits-weather-app
> react-native-scripts start
7:22:54 PM: Starting packager...
***ERROR STARTING PACKAGER***
Warning: 'react' peer dependency missing. Run `npm ls` in C:\Users\subho\Desktop\subhojits-weather-app to see full warning.
If there is an issue running your project, please run `npm install` in C:\Users\subho\Desktop\subhojits-weather-app and restart.
Starting React Native packager...
Scanning folders for symlinks in C:\Users\subho\Desktop\subhojits-weather-app\node_modules (110ms)
Invalid regular expression: /(.*\\__fixtures__\\.*|node_modules[\\\]react[\\\]dist[\\\].*|website\\node_modules\\.*|heapCapture\\bundle\.js|.*\\__tests__\\.*)$/: Unterminated character class
I'm also unaware about what are the other process I need to follow to successfully run the app in my windows system. It would be nice if step by step process can be mentioned in the answer as well. Any help would be appreciated regarding the issue.
Try downgrading your node version, to 12.9.1 it should work.
You should run this npx react-native-windows-init --overwrite and then try
I see you have a regular expression error which is causing this problem. Slash on windows and other OS differed and cause this problem.
The issue you see could be because of this issue. https://github.com/microsoft/react-native-windows/issues/4698

Stuck on info starting JS server

I have initiated successfully a new react-native project. Then, every time I try to run my newly built project using the command react-native run-android, it gets stucks on info Starting JS server....
Here is the output:
$ react-native run-android
info Running jetifier to migrate libraries to AndroidX".
You can disable it using "--no-jetifier" flag.
Jetifier found 855 file(s) to forward-jetify. Using 4 workers...
info Starting JS server..."
I tried restarting the laptop and switching emulators. I don't know what else to do anymore.
How do I solve the problem?
Kill the automatically popped up metro bundler command prompt
Kill the command terminal which is running react-native run-android
Now Run react-native start This will start your js server
In new command prompt window run react-native run-android
The app came up in 5 mins in an emulator.
Linux:
Go to the terminal and type:
react-native start
and then in OTHER terminal, inside your project folder:
yarn android
or
npm run android
Temporary fix:
REACT_TERMINAL= react-native run-android
in my case with manjaro + xfce4:
REACT_TERMINAL=xfce4-terminal react-native run-android
or puts in your .bashrc:
export REACT_TERMINAL=xfce4-terminal
font: https://github.com/facebook/react-native/issues/26097
I had the same problem. I started a project yesterday and it worked, started a new one today and it didn't work. The problem seems to be "#react-native-community/cli-platform-android". The version that showed up today is 2.8.2 as opposed to 2.7.0 for yesterday's project.
I used:
npm install #react-native-community/cli-platform-android#2.7.0
This is not a optimal solution, but it will get you going.
I had the exact same frustrating issue for a very different reason than mentioned in other answers.
As explained in this SO answer Android adb binds to port 5037 and I installed some program which took this port so adb was hanging silently (why adb! .. say something!)
Commands to test if this your issue cause:
test any adb command and see if it hangs, eg:
adb devices
If it does, then check who is using the port:
sudo lsof -i :5037
In my case(Manjaro OS)
First:
npm start
Then in a separate terminal:
npm run android
The best solution that I constantly find myself using, is going to the application manager on android, then clearing the data of the app. Running the app afterwards goes smoothly without lagging.
Reinstalling android studio with a new emulator or changing the app name in app.json , build.gradle and android manifest.xml solved the issue.

WebStorm not running project, Command `start` unrecognized

I'm very new to React Native, barely two weeks into it. I've installed node.js (ver 10.15.0), I've also installed yarn and downloaded WebStorm.
The problem is that I can't run a simple project created by WebStorm, it throws an error
Command start unrecognized. Make sure that you have run npm install and that you are inside a react-native project.
I've cd into my WebStorm projects folder and run npm install in command prompt countless times but it's still throwing the error. Some online suggestions said I should set my path correctly, but I don't really know how to go about it.
Any help will be appreciated.
You should know The best IDE for react native is VSCode (visual studio code) and don't create project with IDE (you should use commands for create project. just use IDE for manage codes)
use CMD or PowerShell (Recommended) for commands
Create a folder for your project and in the project directory run this commands :
npm install -g expo-cli
expo init Yourprojectname
cd Yourprojectname
npm start
For run android project
react-native run-android
For run android project
react-native run-ios
Also its better to read this tutorial : https://facebook.github.io/react-native/docs/getting-started

Categories

Resources