React-native-firebase: Add new packages with npm

Created on 12 Sep 2019  路  12Comments  路  Source: invertase/react-native-firebase

As soon as I started installing new packages on react native firebase, I installed normally, but now after a long time, when installing new packages they remove more than 100 dependencies, how can I solve this problem?

Most helpful comment

Go here: https://github.com/mikehardy/jetifier

Follow the links, read the documentation.

All 12 comments

Please follow the issue template.. No idea what versions you are using.

im using

"react-native": "0.59.3",
"react-native-firebase": "^5.4.0",

but when installing new dependencies it automatically uninstalls other

I've used npm and yarn with react-native-firebase and I have seen no problems like this. That said, I'd waste zero time with RN59 and RNFB5.4.x. Get current - the pain of being pre-AndroidX and on old Firebase SDKs is nearly unsupportable as both firebase and react-native are moving pretty quickly

There is some article talking more about this Android X, I'm reading some files and it appears a lot. is it a new update?

Go here: https://github.com/mikehardy/jetifier

Follow the links, read the documentation.

log:

  • [email protected]
    removed 103 packages, updated 1 package and audited 901147 packages in 37.333s
    found 17089 vulnerabilities (11 low, 17078 high)
    run npm audit fix to fix them, or npm audit for details

Even when I add jetify this happens, I am trying to extract another zip from react-native-firebase-starte with the same version I used in my project 5.4.0 and re-install the same dependencies, still in the new directory of many mistakes, which should not happen.

I never worry about npm or yarn managing sub-dependencies and pruning out packages / versions that are no longer needed. As packages are updated (even within a semver range) they may alter dependencies, resulting in great numbers of packages being added or removed.

before this jetify log or any other package I try to install, some warns like this

npm WARN rm not removing C:\Users\Neander\Desktop\Projetos\Mobile\your_project\node_modules.bin\watch.cmd as it wasn't installed by C:\Users\Neander\Desktop\Projetos\Mobile\your_project\node_modules\@cnakazawa\watch
npm WARN rm not removing C:\Users\Neander\Desktop\Projetos\Mobile\your_project\node_modules.bin\watch as it wasn't installed by C:\Users\Neander\Desktop\Projetos\Mobile\your_project\node_modules\@cnakazawa\watch
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

So when it removes these packages are unnecessary?

I can't be 100% without looking at a diff of the before and after on your package-lock (which I won't spend the time to do, sorry!) but it does appear that there was a buggy version of npm at one point https://stackoverflow.com/questions/44425883/why-does-installing-one-npm-package-remove-many-others - so, maybe it's a problem? Current versions of npm though (assuming you have one) should be managing the whole tree correctly. Are you sure your npm is the most up to date available?

Okay, but yes my version npm is 6.9.0.

After he removed those 103 dependencies, I tried run android, and ...

Task :app:processDebugManifest FAILED
C:\Users\Neander\Desktop\Projetos\Mobile\your_projectandroidapp\src\debugAndroidManifest.xml:22:18-91 Error:
Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to element at AndroidManifest.xml:7:5-117 to override.

See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.

FAILURE: Build failed with an exception.

That's a classic error from a partial AndroidX upgrade. Part of your app is expecting to use the old android support libraries and part is expecting to use the AndroidX libraries. Troubleshooting those is pretty involved as there are so many ways it can happen, and I can't follow through with it now. But in general following through the steps here, carefully, can help resolve https://github.com/mikehardy/jetifier#to-jetify--convert-node_modules-dependencies-to-androidx

Was this page helpful?
0 / 5 - 0 ratings