I am new to React. Although I am studying the react, I am not too clear about the concept react and react-native.
When trying to install react native app I am getting an error:
Command: npx expo-cli init reactapp
ERROR: Node.js v13.14.0 is no longer supported.
expo-cli supports following Node.js versions:
=12.13.0 <15.0.0 (Maintenance LTS)
=16.0.0 <17.0.0 (Active LTS)
When tried to install the latest version I am not able to get that on windows7 can anyone let me know if there's any way to install the latest React version on my OS? Please don't suggest changing the OS. I cant do that.
Your problem is not related to Windows7, it is related to your version of NodeJS (the back-end server-side environment that works with ReactJS). First you install Node, then you install React -- Node is required for React development.
Upgrade your version of NodeJS and all should work.
For your other question:
ReactJS is the programming library (kind of like a framework) for writing React apps. ReactNative (poorly named) is a specialized version of React that is specifically for writing mobile (phone) applications.
You can review this link to see how to install a specific version of NodeJS:
https://www.geeksforgeeks.org/how-to-install-the-previous-version-of-node-js-and-npm/
Here is information re the latest versions of Node that works with Windows7:
NodeJS for windows 7
Check your node version by node -v and if it is older than 12.13.0, try upgrading it to the latest LTS version. hope this resolves your problem.
Related
I use Strapi and Nextjs. When trying to fetch Data threw the Rest api i´m getting the Error (see Screenshot)The Rest API is working and the URL for the fetch is correct as well...
Operating System: Mac OS
Strapi: 4.5.3
Node: 18.12.1
Next: 13.0.6
I had the same issue yesterday and it drove me crazy. I finally fixed it by reverting to older versions of Strapi and Node. Try this:
Install a version manager tool like asdf or nvm
In your project directory, set Node version to v16.19.0
Re-install Strapi using npx create-strapi-app#4.3.8 my-project --quickstart in the terminal (Strapi version 4.3.8)
This solved my issue. Hopefully it works for you too. This Strapi page has some version info that also might be helpful. I used it to determine what versions to revert to:
https://docs.strapi.io/developer-docs/latest/getting-started/quick-start.html#_1-install-strapi-and-create-a-new-project
I'm a beginner and I'm starting a new project with Next.js, but I need to install the 17.0.2 version of React (or any that is below 18) since Material UI does not work very well with the latest version of React.
I tried a lot of commands and searches to find a way to start a new project with a certain version of React or give it a downgrade correctly.
Currently I'm using Yarn.
I started with React Native today and I downloaded react-devtools from npm repo to debug Components hiearchy of React Native Expo app. It works fine, but it crashing sometimes.
Thats why I tried to search for some new version or something and I found, that GitHub repo of this project no longer exists (https://github.com/facebook/react-devtools) and was moved to (https://github.com/facebook/react). I dont understand where I can now found this tool in main React repo? Or project is discontinued? Are there some equivalents? Am I using some Legacy version?
Even debugged in browser (http://localhost:19001/debugger-ui/) telling me to download this app from non-existing repo.
Are there some equivalents?
I have been using reactotron for the need of devtools. This tool has way more options than devtools and the guide to install can be found here
https://github.com/infinitered/reactotron/blob/master/docs/quick-start-react-native.md
previously we were using react native ver 0.59.0 and somehow it's upgraded to ver 0.60.3. As we know that their many major changes in this version, so now with the latest versions we are facing many issues in the development. So are there any ways to downgrade it to ver 0.59.0 again.
So please suggest us anyway to do the same.
Thanks in advance.
You can specify which React Native version to use when creating the project through the CLI by passing the version flag:
react-native init newproject --version react-native#0.59.0
I created my app in react native using Expo but when i run the npm start command its showing me this:
running metro bundler on port 8081
and then
loading dependency graph, done
and never end. what to do?
Here is the complete console output.
First of all if you have a bundler like the one that you have used then it would suggest that you have used react-native init to create you application, instead of expo.
Expo bunders look like this:
If you have created a react-native init and as it suggests in your screenshot that you are building the app on a Windows machine, that means you will be developing on Android.
The instructions for using Android and running react-native are quite long and complicated, they can be found here. For the sake of brevity I am not going to repeat them here asyou can just follow this link. Make sure to choose Building Projects with Native Code -> Development OS: Windows -> Target OS: Android to find the instructions that are pertinent to your situation.
https://facebook.github.io/react-native/docs/getting-started.html
If you are planning on developing on an emulator then you will need to make sure that you have one installed (the link above has all the info that you need). Also you need to make sure that you launch your emulator before running react-native run-android if you do that then it should load on to the emulator and you should be able to see what you are developing on.
If you want to run on your own Android device then you should follow the instructions on this page https://facebook.github.io/react-native/docs/running-on-device (again choosing the options for your situation).
Expo
If this feels like too much effort, you can always try Expo. It doesn't require you to be able to deal with native code. And depending on your use case can be a better option than creating a project with react-native init, plus you can always eject from the expo project and turn it in to a full fledged react-native app.
You install the expo-cli with
npm install -g expo-cli
Then download the expo app from the App Store or the Google Play Store (depending on the mobile that you are using).
Then you can use
expo init
to create your application
Check out the expo documentation for more information https://docs.expo.io/versions/v32.0.0/workflow/up-and-running
Well, Nice question, First of all, I totally understand what's exactly your problem is, let me give you a solution in a very appropriate way.
Basically, there is two way to install and setup React Native Project on your mac and windows machines
1st React Native (native) Method: (That's basically you're using right know
Note: If you're using Apple product - Like MacBook then you can do IOS and Android both platform by using this method, if you're using Windows or Linux you can only do this part for Android platforms
In this method, we have to follow these simple steps
Download Nodejs from Offical website link here
Installing the React Native Cli
npm install -g react-native-cli
If you get an error like Cannot find module 'npmlog', try installing npm directly: curl -0 -L https://npmjs.org/install.sh | sudo sh.
(Only for mac)
Install the Xcode from Appstore (Only for Mac user/macos users)
otherwise
download and install the Android Studio (Stable version) from the official website of Android studio
Setup Xcode (Simulator) or Setup Android Studio for Android devices use (emulator)
by learn and guide from this link here
Note: Basically in your scenario, I'm pretty sure you didn't set up your emulator for android and simulator for IOS that's why you didn't see anything after
2nd React Native with Expo Method: that's you're not using a loading dependency graph
Use
For Android
react-native run-android
For IOS
react-native run-ios
2nd React Native without Expo (that's not your case):
In this method, we have to follow these simple steps
Download Nodejs from Offical website link here
installing expo cli
npm install -g expo-cli
expo init yourprojectname
cd yourprojectname
npm start
Note: Simulators and emulators way same for both