This has happened to me twice now when working on this project. I open the project using expo XDE and it just hangs there loading and never actually opening my project. The first time it happened I just created a new project and copied my code over. I don't want to keep doing that. I've seen posts where people talk about the wifi connection and mine is working just fine.
https://imgur.com/a/0CWDDOC
This second time around I tried running 'exp start' from the CLI when inside my project directory and I get this error
https://imgur.com/kxxIELK
I am able to open my other projects via the command line and with the expo XDE app.
Let me know if there is any other information I can provide!
Versions:
expo XDE: 2.24.4
npm ls react-native : react-native#0.55.4
npm ls expo : expo#28.0.0
npm -v : 6.1.0
node -v : v8.11.1
exp -V : 55.0.4
watchman version : 4.9.0
Related
I was able to build app using expo build:android previously. However, after upgrading to latest expo version I get following error:
connect ECONNREFUSED 127.0.0.1:19001
Set EXPO_DEBUG=true in your env to view the stack trace.
I also see the following lines in the log:
Publishing to channel 'default'...
Building iOS bundle
I don't added ios to my app.json, I only need to build an android apk. To do that I use expo build:android -t app-bundle
I also removed package-lock.json and node_modules and run npm install, but I get the same error.
I run expo start on another cmd and then run expo build:android -t app-bundle still get same error
Also when I clear expo cache, see the following log:
Restarting Metro Bundler...
Starting Metro Bundler on port 19001.
Couldn't adb reverse: adb.exe: error: Invalid source port: 'undefined'
I had faced same issue myself and found the solution. Expo is looking for localhost:19001 which is not running. Just follow following steps and it should work as expected:
Run expo start no terminal and once it opens up the
browser where you will find this line written Starting Metro
Bundler on port 19001.
Now open another terminal instance and run expo build:android.
I am Android Developer, I am new to react native development. For this, I followed bellow React Native Document
https://facebook.github.io/react-native/docs/getting-started.html
I did the following steps
1, I have installed node
2, I Have already installed JDK
3, I have installed Android studio
4, set the ANDROID_HOME path in environment variables
And in command prompt, I did run the following commands
npm install -g react-native-cli
Then create a new application, for this
react-native init AwesomeProject
Then successfully created the application, then go to that folder and run the application.
cd AwesomeProject
react-native run-android
Then getting the following error
And this is the node js error
So please help me, Thanks In Advance.
Try to follow the workarounds here : https://github.com/facebook/react-native/issues/4968.
Kill the bundler process, delete your modules folder, run npm install, rm -rf $TMPDIR/metro-cache-*, also rebuild your android project.
If this doesn't work, you can as well try to create your app using create-react-app toolchain which should be working fine : https://github.com/facebook/create-react-app .
This is a bug within Windows environment for React Native 0.56 you may need to upgrade/downgrade your React Native version. I encountered it, made even worse when I tried to use Typescript.
What I would is run a new project using the latest version 0.57 and just build, if it doesn't build straight away - then use 0.55 until the issue is resolved.
Try this solution, it was worked for me.
Steps to create New React Native project:
react-native init projectName (ProjectName: eg.HelloWorld)
cd HelloWorld
npm start
Open another node command prompt and goto the project path and then run your project with below given command.
react-native run-android
I think you missed 3rd step i.e to start npm.
And if you are again getting same error, follow these steps:
rm -rf node_modules && npm install
rm -rf /tmp/metro-bundler-cache-*
rm -rf /tmp/haste-map-react-native-packager-*
react-native run-android
I'm new to reactnative. I have followed steps to install reactnative properly but, while creating a new project, I'm getting an error. I'm using Windows 7 64 bit with i3 processor.
c:\ReactNativeProjects>react-native init AwesomeProject
Command npm install --save --save-exact react-native failed.
My Folder contains only one file
Since you are starting to use React Native, consider using Expo, I've used it and it makes developing, debugging, testing and deploying to the apple store and google play easier.
According to the official docs:
Expo is the easiest way to start building a new React Native
application. It allows you to start a project without installing or
configuring any tools to build native code - no Xcode or Android
Studio installation required (see Caveats).
Assuming that you have Node installed, you can use npm to install the
Expo CLI command line utility:
npm install -g expo-cli
Then run the following commands to create a
new React Native project called "AwesomeProject":
expo init AwesomeProject
cd AwesomeProject
npm start
This will start a development server for
you.
I've answered a question in SO for the steps and what happens when you build your .apk and .ipa files using Expo, have a look at that as well.
These are my steps to get rid of this error:
Please upgrade your npm
npm install -g npm#latest
Run npm cache clean command in Command prompt ( With some element of doubt for cache presence)
3.Ran react-native init in command prompt as Administrator (on Windows OS), hoping works well with sudo react-native init on Mac OS
If still problem persist make sure that you have followed each and every step mentioned in Documentation i.e. installed JDK, PYTHON, NODE.
Refer to this link For windows
I just updated my react native project to version 0.45
and when using this command : react-native run-ios on the root of this project
I am getting this error :
Cannot find entry file index.ios.js in any of the roots ....
and i can see that the server is trying to look for JS files in
Looking for JS files in
/Users/someUser/Code/ReactTest/node_modules/react-native/packager
when using this command : npm run start -- --root .
i can see that the server is looking for js file in the correct location
Looking for JS files in
/Users/someUser/Code/ReactTest
and every thing is working from here
why the react-native run-ios is try to look in the wrong location ?
I ran into this issue today. As noted here it has been corrected as of version 0.45.1, but this turned out to be a red herring for me.
The most telling problem in my case was that index.ios.js didn't actually exist anywhere in my project, only in some places in node_modules. It turns out that, because I'd initialised the project with the create-react-native-app command, I had to:
npm run eject
You can read more about the eject command here.
If you still have issues, try the below.
Check your dependency versions. Here are my RN packages:
"react": "16.0.0-alpha.12"
"react-test-renderer": "16.0.0-alpha.12"
"react-native": "^0.45.1"
Update your dependency managers. These worked for me:
$ yarn --version
0.18.1
$ npm --version
4.6.1
Clean your cache(s). WARNING - CONTAINS rm -rf, COPY WITH CARE.
watchman watch-del-all
rm -rf ./node_modules
yarn cache clean
rm -rf $TMPDIR/react-*
yarn install
npm start -- --reset-cache
After that last npm start, hit CTRL+C and ensure there are no dormant npm processes running in the background. Then, try react-native run-ios again.
The react-native launched new release 0.45 a few days back. So, the commands to create a react-native application and running locally have many differences.
npm install -g create-react-native-app
Then run the following commands to create a new React Native project called "AwesomeProject":
the new way of creating a react-native application as follows
create-react-native-app AwesomeProject
cd AwesomeProject
npm start
Please follow the official documentation for creating an application and running the application on locally. hope the below link will help you.
https://facebook.github.io/react-native/docs/getting-started.html
Once you've set these up, you can launch your app on an Android Virtual Device by running npm run android, or on the iOS Simulator by running npm run ios(macOS only).
Enjoy, Happy coding :)
I just started on a fresh dev environment with Xcode 7.2.1, and installed react-native (0.20.0). I initialized a test project to see if it would run, and I got the following error:
~/dev/TestProj/node_modules/react-native/packager ~
packager.sh: line 11: node: command not found
The iOS Simulator screen says:
Could not connect to development server.
Ensure the following:
- Node server is running and available on the same network - run 'npm start' from react-native root
- Node server URL is correctly set in AppDelegate
URL: http://localhost:8081/index.ios.bundle?platform=ios&dev=true
Sure enough, if I go into the project folder in a terminal window and run 'npm start' from there, the packager starts and everything works. In my experience the packager should run by itself though when you run a project with React Native. Am I doing something wrong here or is there an issue? Never had this happen with previous versions of RN.
I moved on to trying to get my old project working, and while trying to use npm to add new packages, I added the following to my ~/.profile. I'm guessing this fixed it:
export NPM_DIR="$HOME/.npm" [ -s "$NPM_DIR/npm.sh" ] && . "$NPM_DIR/npm.sh"