so I am working on some React Native projects and up until now, Expo has been working great along with Android Studio. However, I think I updated my graphics card drivers a couple of days ago. Now when I try to run "expo start" I receive a "bash: expo: command not found" error.
Any ideas? I keep seeing all this stuff about adding NPM global to my paths but all of those issues/solutions seem to be for Mac. I have no idea how to go about correcting this on a Windows 10 machine. Any thoughts?
expo is not installed on the machine anymore for some reason
since it is an expo project it is straightforward first go to Nodejs webpage
download LTS version NOT THE CURRENT VERSION once node is succesfully installed on the machine it will you can check by opening the command prompt and typing node --version
you should see something like "14.1232."
then run this command npm install -g expo-cli it should install expo again globally
navigate to your project folder and do "expo start" it should work
Related
i have a this little issue.
I have a new laptop, and I decided to do react project.
I installed the Node's stable version, installed the the npm create-react-app globally, and created a new project using this command npx create-react-app tip-calculator.
Everything was set up for me, only deleted a few files on the src folder, and kept the essentials (index.js, app.js and index.css).
My issues, is on my previous laptop, when doing projects, the webpack (is what i think it is) didn't show up in the console, and on the new laptop, it shows, and I would like it removed.
This is a freshly baked react project, so I didn't touch it's code, aside from the files I deleted.
It's not an issue, it's expected behavior by react-scripts because these logs are hardcoded in react-scripts and currently, there are no options for disabling them. You have probably had an older version of create-react-app in your previous laptop which might have not logged this information on the console.
What is really happening is that you are running react-scripts with npm start and react-scripts are logging webpack logs.
There is also this question which is similar to yours about running react-scripts silently.
If you really don't want to see the output you can redirect it to null:
Linux & Mac: npm start > /dev/null
Windows CMD: npm start > null
Windows Powershell: npm start > $null
I am trying to build a react native app. I have caught an error on the terminal saying
Unable to resolve "./useValue" from "node_modules\react-native-reanimated\src\Animated.js"
I reinstalled react-native-reanimated to the expected version range.
`Some of your project's dependencies are not compatible with currently installed expo package version:
react-native-reanimated - expected version range: ~1.9.0 - actual version installed: ^1.10.1
Your project may not work correctly until you install the correct versions of the packages. To install the correct versions of these packages, please run: expo install [package-name ...]`
Thus, I run the code as follow: npm install react-native-reanimated#1.9.0, but still run into the error code.
I could realy use some help on this.
try uninstalling the package ==> close ide (all instances) ==> open the ide ==> install the package again ==> run "expo start -c"
Only do this:
expo start --clear
From Expo Documentation at Expo Start command.
--clear, -c | Clear the React Native Packager cache.
Is it possible to open a project made in builderx? I found that tool and it is good, but when trying to emulate it with expo it gives me many mistakes, is there anyone who uses this tool? If so, can you tell me how I can emulate the project?
You can either download the whole project and then run yarn or npm install. Or you can download the component and then use it in your existing react native project.
If you are downloading a component in which some third party components are used, you will have to add those libraries manually in your existing project by yarn add [library-name] or npm install [library-name] --save.
You can check this
Save your project in BuilderX. It will give you the Expo project.
Go to the root of the project in terminal. run the following commands.
"npm install" or "yarn"
"npm start" or "yarn start", once this command is run successfully, you'll get a QR code at the end of the output
Scan the QR code in Expo App of your mobile and It will run the project in Expo.
I am unable to get the default "awesomeproject" react-native app working on my new Mac/IOS simulator.
I have installed all the prerequisites on my new mac as listed here:
https://facebook.github.io/react-native/docs/getting-started.html.
After installing everything I run
sudo react-native init awesomeproject.
This seems to work correctly.
I then cd to awesomeproject and run
sudo react-native run-ios
It eventually builds "successfully" and launches the iPhone simulator.
It launches a new terminal for the packager and here it shows loading dependency / graph: done. But it does show a watchman ERROR. See screenshot.
After this, nothing happens. It doesn't launch/install the app on the simulator. The terminal that I ran react-native run-ios is at the command prompt.
I have looked at the troubleshooting guide and other posts, but can't see what I'm missing? I am just trying to do the basic 101 of getting this working on a mac.
I'm running
MacOS: 10.14.5
React-Native version 0.59.9
react-native-cLI: 2.0.1
Xcode 10.2.1
Node: 10.16.0
Either create project again without sudo and run it without sudo or you need to run watchman with sudo permissions. I would suggest creating project again. Please avoid using sudo as much as you can. Thanks
I am coding with React Native. I don't see that when I first create react-native app for check running. When I implements my code see that. My purpose is generate apk.
app.json
build.gradle
index.js (index.android.json)
App package.json
Solved
Result: I solved my problem with npm install. I would like say many month after.
If anyone's getting this error after upgrading Expo, try restarting your simulator - that fixed it for me.
Here is my experience if someone using expo sees those error message.
I accidentally installed expo manually in my project which was version 29.0.0.
I was using version 28.0.0 of expo sdk, so it may have crashed inside.
What I did:
manually upgrade sdkVersion of app.json to 29.0.0.
change sdk version to 29.0.0 for react-native.
Had exactly the same error - fresh machine, fresh npm, only one version of expo installed.
Turns out, expo requires you to build it as an app before it can send it to the expo app properly (at least on Android). This is easiest done by:
Adding an "android" section to app.json, with the contents "package": "uk.co.yourcompany.yourpackagename" (this is required by android packages. It can be complete garbage, but should follow that format - a backwards domain name)
running expo build:android and following the instructions to sign up to expo's servers and build the app
then restarting expo start
Not sure if this is documented anywhere though, so may be a new thing?
Another thing to try is to move your node_modules folder away (or maybe delete it, up to you) and re-run npm install
According to the official tutorial: https://facebook.github.io/react-native/blog/2017/03/13/introducing-create-react-native-app.html
If you want to use expo in your application, you must create it in the following way
npm i -g create-react-native-app
create-react-native-app my-project
cd my-project
npm start
This will start the React Native packager and print a QR code. Open it in the Expo app to load your JavaScript.
as I see your code has files that are not necessary, such as build.gradle and index.js, the structure that create-react-native-app creates is different and easier to use
I was getting the same error after updating the expo-cli to version 3.0.6.
By looking at my package.json I noticed the expo-cli version installed on my computer is not the same as package.json. so I changed it to "expo-cli": "^3.0.6" and ran npm install || yarn, then the error disappeared!