1. Straight forward solution.
In most of the cases, this will sort out this error by upgrading the react-native package in the root folder.
- Go to the Project Root.
- Upgrade the React native package in the Command Prompt by typing :
react-native upgrade - Then Accept to update all the Files by typing y (Yes) in the Command Prompt.
You might see another option saying to upgrade git related package as the following message:
"You should consider using the new upgrade tool based on Git. It makes upgrades easier by resolving most conflicts automatically."
- Go back to the old version of React Native.
- Run
npm install -g react-native-git-upgrade - Run
react-native-git-upgrade
Your project needs to have a name, declared in package.json, such as "name": "AwesomeApp". Please add a project name. Aborting.