1
votes

I want to downgrade my project as some of the third party packages are not updated with the latest version of react-native. I am using Xcode 9.0

When I try to downgrade my react-native version, I get this error:

error: /Users/........./node_modules/react-native/ReactCommon/privatedata/PrivateDataBase.h: No such file or directory

Points I followed:

In package.json I changed the version from 0.51 to 0.45

Then run npm install.

1
You also need to change other module versions that support with react-native 0.45. Right now all modules are related to react-native 0.51, not 0.45 - Nisarg Thakkar
I want to add react-native-permissions but it displays unmet peer dependency with 0.51 - Ankush Rishi
That means that whatever version of react-native-permissions you are using supports 0.51 or higher. - MattyK14
You need to add react-native-permissions version that supports with react native 0.45. - Nisarg Thakkar

1 Answers

1
votes

If you change something in your package.json, make sure you delete also your package-lock.json.

I always execute after i change something the following script:

watchman watch-del-all 1>/dev/null

rm -rf node_modules 1>/dev/null
rm -rf yarn.lock  1>/dev/null
rm -rf package-lock.json 1>/dev/null
rm -rf $TMPDIR/react-packager-* 1>/dev/null
rm -rf ios/build 1>/dev/null
rm -rf android/build 1>/dev/null

npm cache clear --force -s 1>/dev/null
npm cache verify 1>/dev/null

from: https://gist.github.com/skizzo/8633169b4f1b0e781c83af4d52ec7249

If you still have some issues with version missmatch, try:

npm uninstall your-package-you-want-to-remove &&  npm install [email protected] (fixed version number)
react-native link