Warning: Invalid version react-native#0.64.2 for expo sdkVersion 43.0.0. Use react-native#0.64.3 - react-native

I am working on an expo project and everything is working fine, but I began to get a warning message when android is building as
Warning: Invalid version react-native#0.64.2 for expo sdkVersion 43.0.0. Use react-native#0.64.3
The app is still running fine but I don't how to fix this error yet and I want to know if it won't cause an issue later.

I have tried to run npx react-native upgrade 0.64.3 but it didn't work, I got this error
info Fetching diff between v0.64.2 and v0.64.3... error Fetch request
failed with status 404: 404: Not Found. error Failed to fetch diff for
react-native#0.64.3. Maybe it's not released yet?
changing the version of react-native manually in the package.json and run expo install worked for me

I use the expo doctor command it allows diagnose issues with the project.
I would recommend using the expo upgrade command. It upgrades the project packages and config for the given SDK version.
More to find here.

I just faced the same issue. Basically it's telling you should use a higher version of your react-native. I solved it just by updating it to the specified version.
npx react-native upgrade 0.64.3
More info here.
Cheers,

If as in my case one need a specific version of react-native, let's say older because some legacy dependencies in a particular project that for some reason can't be upgrade, then change the version in the package.json won't work.
What worked as the cli suggested is to use:
expo doctor --fix-dependencies
That installed the correct lower version of react-native

To find out actual problems run this command :
expo doctor
To solve all problems regarding package conflicts run this command:
expo doctor --fix-dependencies
Use sudo on Unix based OS if you have permission issue to run those commands.

To solve the error, I used the below command:
npm install react-native-clean-project --save-dev
It is a library that allows us to resolve conflicts.
This library is added to your dependencies.
This handles the problem and if it is not the case add this command:
react-native clean-project-auto

Related

Why can't I install the React Native Testing library?

I'm new to app testing and have started delving into this topic since yesterday. I wanted to write tests for my React Native app and tried to install React Native Testing Library with this command:
npm install --save-dev #testing-library/react-native #testing-library/jest-native
Then I ran into the following problem:
I tried to find a solution to this problem in Google, but I did not succeed. As far as I understand, the problem lies in the dependencies?
Please tell me what can I do in this case?
P.S. I tried to create a completely clean project with expo init, tried to install the library but got exactly the same error
Hit the same issue and didn't want to update everything at the moment so I solved the issue by running a suggestion on the npm error output:
npm install --save-dev #testing-library/react-native --legacy-peer-deps
It worked for me
it looks like you are running into a conflict with your react version dependencies. Please check the named modules for required packages they depend on.
Please have a look with: npm outdated and then maybe try to update your settings via npm update
also take a look here if you want: updating npm dependencies
you need to update react version after updating just install the latest version of testing-library

React Native Fails To Start Server With Error In #react-native-community/cli/build/commands/doctor/healthchecks/index.js

I just created a brand new React Native project, and I can't get it to run. The server always fails on the following:
node_modules/react-native/node_modules/#react-native-community/cli/build/commands/doctor/healthchecks/index.js:48
} catch {}
^
SyntaxError: Unexpected token {
The only thing I've found on this issue is this thread, which ends with people saying to post this question on Stackoverflow, hence why I'm here. I've tried the usual: upgrading node versions, removing node_modules and reinstalling, restarting my machine, all to no avail. I even delved into the code to see if I could figure out what's going on, but nothing jumped out at me.
My hope is that others have run into this with new React Native projects and that someone can help me resolve it. Any suggestions are welcome. Thanks!
Sigh.... Well after struggling with this for a day I found the workaround was to run npx react-native start in one console and then run npx react-native run-ios in another. I was just trying to do the latter by itself (which always worked in the past), and I guess that doesn't work anymore.
Probably your node and/or npm version is to old. Check by npm -v and node -v and update to latest version, or suggesting by react-native crew in dependencies from node site. Or if you use nvm try:
nvm install 16.14.0 && nvm alias default 16.14.0 && nvm use 16.14.0
Note that, this is for specific version. For latest, type:
nvm install --lts --latest-npm
nvm use x.x.x //latest installed version
This problem is due to node version. Upgrade your node verion above 12. It will solve the problem.
Use can either use nvm or directly install the node
if you are using android studio start it with command line
like this cd /path/to/android-studio/bin
then studio.sh make sure its executable

expo always returning me with "-bash: expo: command not found" everytime i go to set up a project, "expo init projectname". how do i resolve this?

have downloaded latest version of node.js on mac
terminal says ive downloaded latest version of expo cli
if i try to run my first project in terminal; expo init project name, am always met with the same error. -bash: expo: command not found.
when i check terminal to make sure that expo is installed, i am also met with: -bash: expo: command not found.
i have spent at least 3 days trying to resolve this problem.
any help towards this resolution would be greatly appreciated
How have you downloaded the Expo CLI? It may be important to note that if you don't install the package globally, like npm install -g expo-cli, it may not be properly executable.
[Additionally, One thing I've found when installing commands is that it can help to restart your terminal. Sometimes after you've installed something new, not everything will be in place, but it might be there when the terminal restarts.]

Struggling to set up nativebase in a React Expo project

I have tried so many different ways to set nativebase up with expo and am still having an issue. At the moment I'm using the
Getting Started documentation found on the nativebase website.
I first create a new app with expo using
expo init myapp
Then I install nativebase using
npm install native-base --save
Then I finally install the font
expo install expo-font
I even copy the App.js found in the getting started documentation, and after I start the app and try to run it on an emulator I face the below error
Unable to resolve "#expo/vector-icons/Fontisto" from "node_modules\native-base\dist\src\basic\IconNB.js"
Failed building JavaScript bundle.
What am I missing? Coming from .NET world this whole process with dependencies is so painful...
*Edit 1
I'm sure someone will make mention of the fact that the error message mentions #expo/vector-icons and I have not installed that. When running before I install this package I get that error, and after I install the mentioned package I still face the exact same error.
Please try with this version of native base :
npm i --save-exact native-base#2.13.8
Expo should release a version with that version .
Hope it helps. feel free for doubts
We can run the below command with Expo
npm i --save-exact native-base#2.13.8
Still this version is not available, but its working, really don't know why?

React Native - Can not create new project via react-native-cli when react-native version is > 0.55

I am trying to create new project via react native project via react-native-cli react-native init ProjectName and get the following error
error Found incompatible module info
Visit https://yarnpkg.com/en/docs/cli/add for documentation about this
Error: Command failed: yarn add react-native --exact
Project can be created with the same command when react native version is less then or equal to 0.54
react-native init ProjectName --version react-native#0.54
The following links also did not helped me.
https://github.com/facebook/react-native/issues/14861
https://github.com/yarnpkg/yarn/issues/3227
I solve the problem just moment.
the reason is node version problem.
you can install >10.0 node.
then, react-native init project succeed.
I came across similar issue. Following are the steps I took to solve it.
Noticed the yarn error occurs due to incompatible node module version. It required node version >= 8.0. For this, I changed the node version using nvm:
nvm use 8.0.0
Note: Check first if you have a installed node version >= 8.0 using nvm list. If yes, just use the above command. Otherwise install it by nvm install v8.0.0.
After this, you might come across similar error for npm. I did not have updated npm version. Install latest npm by npm install -g npm#latest
Try to create new react-native project, react-native init HelloWorld.