I have used create-react-native-app and expo to build an application on a vagrant ubuntu and run it using yarn start.
When i make changes to my file on my host machine, the changes are not
reflected.
With create-react-app, CHOKIDAR_USEPOLLING=true worked and all my
changes were reflected instantly but this is not the case for native.
Does anyone know how to get this to work?
Please try using yarn start instead of npm start since your current of npm (5) has issues with create-react-native-app as of today.
Related
When I run the command "yarn start", the expo web starts automatically, and even if I open the expo client app on my iPhone the link on my app takes me to Safari and opens up a webpage. How can I open the app on expo CLI and not on my phone's browser (Safari)?
I have also tried the command "expo start --ios" and when I run it I get the error
"Simulator not installed. Please visit
https://developer.apple.com/xcode/download/ to download Xcode and the
iOS simulator. If you already have the latest version of Xcode
installed, you may have to run the command sudo xcode-select -s /Applications/Xcode.app".
I don't want to run the app on a simulator or phone's browser instead on my phone using expo client
I was dealing with this issue also hoping someone would find a solution. However, I have found the solution that worked for me at least. What I did is installed the react-native cli (reinstall if already installed) and then ran npm install in my project and it went back to normal and stopped going on my phones browser. Search documentation regarding this to install those things. I installed them in the order stated and it worked.
try update your expo-cli version and see if it helps. npm install -g expo-cli
Below is my situation,
By default Expo uses yarn. I installed any new dependencies using npm, then by default expo is built with web.
Solution:
use yarn always to install new dependencies or
use npm install once to install and now expo will build project with android or ios
On Linux try with sudo:
sudo npm install -g expo-cli
Then install packages and run:
yarn
Then run the following to clear cache and start expo:
expo start -c
This issue usually happens when you install a new npm package. You can either uninstall/reinstall the package or run the above three steps and solve your problem.
I try to execute command npm start on terminal on my Mac.
It prompts me to install Expo CLI , I say Y, wait until installation to finish, then I end up in an endless loop where it keeps prompting me to install Expo CLI again:
This command requires Expo CLI.
Do you want to install it globally [Y/n]? y
Installing the package 'expo-cli'...
Expo CLI installed. You can run `expo --help` for instructions.
This command requires Expo CLI.
Do you want to install it globally [Y/n]?
Any ideas why I'm having this?
Turns out my profile file was messed up (I had previously installed Anaconda which seems to have changed .bash_profile entries)
I removed all those stuff and inserted the correct $PATH that bash should look into. That was it.
I have faced similar issue. I have a few solutions. Try if they work out for you.
In case you have added the path multiple times remove it.
Ensure that there are no blank spaces or blank lines after the Path.(This one worked for me)
Manually install expo-cli with npm install expo-cli before running npm start. This worked for me.
Has anyone made eslint work with create-react-native-app in vscode on Windows 10? It is so unstable it's making my skin itch!
Latest npm doesn't work with create-react-native-app so I installed yarn. Now I can create an app. But I have to do this with cmd prompt outside of vscode otherwise I get no QR code to launch app on my phone.
I tried to install eslint locally with yarn, and use airbnb linting rules - this fails - if I install it with npm it works and I can initialise it with airbnb rules. Yay! I now have linting in my project.....but wait! Now I cannot start my project anymore because:
react-native-scripts start
'react-native-scripts' is not recognized as an internal or external command,
operable program or batch file.
This is killing me!! It's taken about 8 hours of $%^#ing around and I haven't even got to try any react native coding yet! Is it supposed to be this insane just to set up the environment?!!?
Anyone have any suggestions? I googled and looked at github issues but I see no solutions for this.
Thanks in advance!
Version 1.5.2 of create-react-app has options for using npm instead of Yarn as well as using a specific npm version. Use create-react-app -h to view help.
Have you also tried adding the following to your VS Code settings when using Yarn?
"eslint.packageManager": "yarn"
I've made a fresh clone of a react-native project which is 100% ok and working. Installed react-native-cli, trying to run react-native start in the project dir, but I get Command start unrecognized. Make sure that you have run npm install and that you are inside a react-native project.
I tried to init a fresh project just to test, and it worked fine, I was able to run react native commands there and everything worked.
It's definitely not an issue with my project because other people work on it as well and it's 100% ok and valid. This is some issue with react native or some other lib, I suppose. What could that be?
I'm using mac os sierra and project's react native version is 0.40.0
So, I've resolved this issue finally, and, to whoever it may concern: the problem wasn't with react-native. The problem was with npm. I was using yarn, and had npm 5 installed on my system. Also I had a postinstall script, which called rn-nodeify. rn-nodeify, in turn, on the final stage called npm (not yarn), and since it was npm 5 I was experiencing an npm 5 bug, which wiped out my modules. The bug is described e.g. here. Downgrading to npm 4 solved this issue for me.
I'm just starting out with react native. Everything was going ok but now when I run 'react-native run-ios' the packager is looking for js files in
<project-root>/node_modules/react-native/packager
instead of
<project-root>
If I run 'node node_modules/react-native/local-cli/cli.js start'
it looks for files in the correct location.
This is happening in my existing project and if I create a new project using react native init. It started after I installed a new npm module. I've since reverted the change, re-installed modules, cleared the tmpdir cache, rebooted computer etc. Can I explicitly configure the packager entry point?
Any help greatly appreciated
C
This is a known issue with RN 0.45, I have also encountered this problem today after upgrading from 0.42.
https://github.com/facebook/react-native/issues/14246
The temporary solution until RN is fixed (next release?) is to run:
npm start -- -reset-cache
You can also try:
npm run start -- --root <mydir>
This will cause the packager to look in the correct location.
Until this is corrected it's a pain, as it means we have to invoke the reset every time the packager is started either from XCode or react-native run-ios.
The next release is later this month: https://github.com/facebook/react-native/releases/tag/v0.46.0-rc.0
Update
This has now been fixed in release 0.45.1
What worked for me was reverting to 0.43.1 (a version that I have other apps working with): delete node_modules, change package.json under dependencies to "react-native": "0.43.1", and npm install. Verify your version with react-native --version, and run again.