react native how to upgrade project version 0.61.0to latest version - react-native

React native 61 to 64 +
current version 0.61.0
upgrade to latest version
best way to upgrade project

npx react-native upgrade cd ios pod install
for upgrade to specific version You may specify a React Native version by passing an argument, e.g. to upgrade to 0.64.0
npx react-native upgrade 0.64.0

It's not simply change the version and npm install again. You may view the official documentation for help.
https://react-native-community.github.io/upgrade-helper/

Related

how can I update the newest react-native-reanimated version with expo?

how can I update the newest react-native-reanimated version with expo ?
if I write this:
npx expo install react-native-reanimated
then I dont get the latest reanimated version
Run npm install react-native-reanimated for the latest or change package.json yourself and run npm install afterwards. Remember that expo has ben tested against fixed versions of reanimated, so you will get warnings from expo if you upgrade it yourself.

Some dependencies are incompatible with the installed expo package version

Hello I am learning expo for react Native and while running my app i get the error below. My app runs fine but i just want to get rid of the error.
is there something like npm update i can do to get rid of this error
here is the error:
Some dependencies are incompatible with the installed expo package version:
#react-native-picker/picker - expected version: 2.4.0 - actual version installed: 2.4.2
react-native-safe-area-context - expected version: 4.2.4 - actual version installed: 4.3.1
react-native-screens - expected version: ~3.11.1 - actual version installed: 3.13.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 doctor --fix-dependencies,
or install individual packages by running expo install [package-name ...]
actually this does the trick
expo doctor --fix-dependencies
It appears to be that the expected version of some of your installed libraries are lower than the actual versions that you installed. You need to downgrade your dependencies to match the expected version to get rid of the warnings.
First you will need to uninstall the above packages by the command: npm uninstall [library-name]. For example: npm uninstall react-native-screens
After that, you will need to reinstall the above libraries using their recommended version: mpn install react-native-screens#3.11.1
You can also refer to this for more information: How do I down grade my react navigation in a current react-native project?

In, react-native info how to check RN version?

In Terminal,
react-native: 0.68.0 => 0.60.0
does it mean that this project version is 68 or 60? In pacakge.json, i manually changed it to 0.68 and then npm install. and I checked react-native info.
Don't try to change manually react native version because sometimes as per version level some internal files or set up not done properly and it will create issue for running project Use below command for upgrade project
npx react-native upgrade
If you want to upgrade specific version then use below command
npx react-native upgrade 0.68
after then check react native version It will show 0.68

New react-native-app with react-native 0.59.9 or lower

What is the best/easiest way to create new react-native-app using react-native-0.59.9 or lower?
Trying to use https://github.com/futurepress/epubjs-rn , which only runs in react-native 0.59 or lower.
The example app in https://github.com/futurepress/epubjs-rn/EpubReader does not work out of the box.
please use epubjs-rn-62
usage
To use the components in your own app install via npm or yarn
npm install --save epubjs-rn
import { Epub } from 'epubjs-rn';
Then you can add the reader element in your code:
<Epub src={"https://s3.amazonaws.com/epubjs/books/moby-dick/OPS/package.opf"}
flow={"paginated"} />
In order to start a new project with a specific React Native version, you can use the --version
react-native init ProjectName --version="0.59.9"
Check official documentation for more information.
EDIT
But in order to run an older version, you need to downgrade your React Native CLI version according to Compatibility of React Native CLI.
If you have already installed a version of react-native CLI, uninstall it using
npm uninstall -g react-native-cli
Then you have to install an older version as below,
npm install react-native-cli#1.0.0
Hope this will help you.

React Native version check

I wanted to check the version of the react native I was using in my project when I used the command from my root folder :
D:\Reactnative\Albums>npm view react-native version
0.56.0
The version was 0.56.0 which is not the version I have installed, but on:
D:\Reactnative\Albums>react-native -v
react-native-cli: 2.0.1
react-native: 0.55.4
The version mentioned here is 0.55.4, which is correct.
So why this conflict?
npm view react-native version
You can check the latest version of react native. You can run it under the root of your project or everywhere. Of course, you will need internet connection to check latest version.
react-native -v
If you run under the root of project, it will return the version of two npm packages, react-native-cli and react-native. Those versions are using in your project.
Just wanted to clarify Aung's answer:
npm view react-native version checks globally while react-native -v ran inside project's root folder checks version of the app itself.
Macbook M1 Chip
npm view react-native version