Unable to install firebase in expo - firebase

I using expo 3.27.10 and node v12.18.4 below is package info I tried to install firebase using expo and npm both fails then how I initialize firebase config file
firebase.initializeApp(firebaseConfig);
firebase.analytics();
and package.json is
"dependencies": {
"#react-native-community/masked-view": "0.1.10",
"#react-native-firebase/analytics": "^7.6.4",
"#react-native-firebase/app": "^8.4.3",
"#react-native-firebase/auth": "^9.2.3",
"#react-navigation/native": "^5.7.4",
"#react-navigation/stack": "^5.9.1",
"expo": "~39.0.2",
"expo-status-bar": "~1.0.2",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-39.0.2.tar.gz",
"react-native-gesture-handler": "~1.7.0",
"react-native-reanimated": "~1.13.0",
"react-native-safe-area-context": "3.1.4",
"react-native-screens": "~2.10.1",
"react-native-web": "~0.13.12",
"firebase": "7.9.0"
},

For me I have to change node version current 14.13 to LTS 12.18 and this allows me to install firebase

If: expo install firebase
isn't work for you and you got an Error,
That maybe you are having an old npm version uou need to update your npm
npm update
Or you got error for installation that because FIREBASE made update so to fix it use
yarn add firebase
see more: https://www.npmjs.com/package/firebase

I had a similar issue. What I did:
- remove firebase from the package.json.
- npm update
- npm install
- npm install --save firebase
afterwards had to change import * as firebase from 'firebase' to
import firebase from 'firebase'
if(firebase.apps.length === 0){
firebase.initializeApp(firebaseConfig)
}
p.s: working with VSCode, node v14.15.1, firebase 8.2.7

Downloading 2019 visual studio tools solved the error for me. You can scroll down and download only 2019 tools if you don't Want Visual Studio.
Click the link to download here

Related

ReferenceError: Can't find variable: IDBIndex when using Firebase on Expo

I'm developing an app using Expo, using the Firebase JS SDK (https://docs.expo.io/guides/using-firebase/), only for Authentication and to use the Cloud Firestore Database. It works fine on browser but when I switch to Expo Go I get this error:
ReferenceError: Can't find variable: IDBIndex
It's my understanding that the Firebase SDK should work fine aside from when using Analytics, which I'm not using. I have spent hours googling this issue but most people refer to an issue with Analytics, so any help would be really appreciated!
My package.json:
"dependencies": {
"#react-native-community/masked-view": "0.1.10",
"#react-navigation/native": "^5.9.4",
"#react-navigation/stack": "^5.14.4",
"expo": "~41.0.0",
"expo-status-bar": "~1.0.4",
"firebase": "8.2.3",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz",
"react-native-datefield": "^0.1.0",
"react-native-gesture-handler": "~1.10.2",
"react-native-reanimated": "~2.1.0",
"react-native-safe-area-context": "3.2.0",
"react-native-screens": "~3.0.0",
"react-native-web": "~0.13.12"
},
"devDependencies": {
"#babel/core": "^7.9.0"
}
I fixed this issue by using firebase#9.1.0. In the expo docs they mention that they are using this version in their example. https://docs.expo.dev/guides/using-firebase/
With newer versions of Firebase I encounter the same issue.

CocoaPods could not find compatible versions for pod "Firebase/CoreOnly": React native firebase

Upon trying to update my pods to the latest in order to work with IOS 12.0 I keep getting this error. I've seen this error pretty well documented online but none of the current solutions I have found seem to work.
In Podfile:
RNFBApp (from `../node_modules/#react-native-firebase/app`) was resolved to 10.5.0, which depends on
Firebase/CoreOnly (~> 7.4.0)
RNFBAuth (from `../node_modules/#react-native-firebase/auth`) was resolved to 10.5.1, which depends on
Firebase/Auth (~> 7.4.0) was resolved to 7.4.0, which depends on
Firebase/CoreOnly (= 7.4.0)
react-native-camera/BarcodeDetectorMLKit (from `../node_modules/react-native-camera`) was resolved to 3.42.0, which depends on
Firebase/MLVisionBarcodeModel was resolved to 5.0.0, which depends on
Firebase/CoreOnly (= 5.0.0)
As far as pod install --repo-update and pod update etc I keep returning to this error. I've updated my dependancies manually in the package.json file to the latest and removed the pod.lock file. I've run a react native clean across it to ensure all cache files are cleaned and tried to reinstalling everything and still getting the error.
I'm sure I'm missing something that I either need to wipe somewhere but can't find where exactly I need to do this.
Here's my Pod file
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
platform :ios, '12.0'
target 'shoppinStore' do
config = use_native_modules!
use_react_native!(:path => config["reactNativePath"])
target 'shoppinStoreTests' do
inherit! :complete
# Pods for testing
end
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable these next few lines.
use_flipper!
post_install do |installer|
flipper_post_install(installer)
end
end
target 'shoppinStore-tvOS' do
# Pods for shoppinStore-tvOS
target 'shoppinStore-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
end
# add the Firebase pod for Google Analytics
pod 'Firebase/Analytics'
# add pods for any other desired Firebase products
# https://firebase.google.com/docs/ios/setup#available-pods
pod 'react-native-camera', path: '../node_modules/react-native-camera', subspecs: [
'BarcodeDetectorMLKit'
]
And my Package.json
"name": "shoppinStore",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"#react-native-community/checkbox": "^0.5.7",
"#react-native-community/geolocation": "^2.0.2",
"#react-native-community/masked-view": "^0.1.10",
"#react-native-firebase/app": "^10.5.0",
"#react-native-firebase/auth": "^10.5.1",
"#react-native-firebase/firestore": "^10.5.1",
"#react-navigation/bottom-tabs": "^5.11.3",
"#react-navigation/native": "^5.9.0",
"#react-navigation/stack": "^5.13.0",
"firebase": "^8.2.3",
"react": "16.13.1",
"react-native": "0.63.4",
"react-native-camera": "^3.42.0",
"react-native-gesture-handler": "^1.9.0",
"react-native-reanimated": "^1.13.2",
"react-native-safe-area-context": "^3.1.9",
"react-native-screens": "^2.16.1",
"react-navigation": "^4.4.3",
"react-redux": "^7.2.2",
"redux": "^4.0.5"
},
"devDependencies": {
"#babel/core": "^7.8.4",
"#babel/runtime": "^7.8.4",
"#react-native-community/eslint-config": "^1.1.0",
"babel-jest": "^25.1.0",
"eslint": "^6.5.1",
"jest": "^25.1.0",
"metro-react-native-babel-preset": "^0.59.0",
"react-test-renderer": "16.13.1"
},
"jest": {
"preset": "react-native"
}
}
I'm pretty new to React Native, this all happened after chasing errors trying to connect my phone to test the app to get the React Native Camera library to work. Not the project won't build at all. Any pointers will be greatly appreciative.
I had this problem due to M1 chip.
I deleted Pods folder
Deleted PodFile.lock
For M1 chip :
1. Install ffi
sudo arch -x86_64 gem install ffi
2. Re-install dependencies
arch -x86_64 pod install
I was getting this also so I updated my firebase packages in package.json, deleted podfile.lock in the ios folder, and ran pod repo update, then pod install.
Worked after that! Good luck!

react-native link gives error for react-native-firebase

I am trying to link react-native-firebase library based on the tutorial, and as soon as I run the command:
react-native link react-native-firebase
I get the following error:
Scanning folders for symlinks in
/Users/christkhodabakhshi/projects/FlashCard/node_modules (18ms)
rnpm-install info Linking react-native-firebase ios dependency
rnpm-install WARN ERRGROUP Group 'Libraries' does not exist in your
Xcode project. We have created it automatically for you.
rnpm-install ERR! Something went wrong while linking. Error: Cannot
read property 'children' of null
Please file an issue here: https://github.com/facebook/react-native/issues
Cannot read property 'children' of null
and the following is my package.json
"expo": "^29.0.0",
"expokit": "^1.5.0",
"firebase": "^5.3.0",
"react": "16.3.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-29.0.0.tar.gz",
"react-native-firebase": "^4.3.1",

Angular 5 + Firebase: Namespace 'firebase.auth' has no exported member 'IdTokenResult'

I am currently work on web project using Angular 5 and I want to integrate the Firebase Cloud Messaging to send notification on app, bt I faced to a lot of problems that I tried to fix them. Right now there two errors that I'm not able to fix concerning: Namespace 'firebase.auth' and functions
The errors look like:
ERROR in node_modules/angularfire2/auth/auth.d.ts(12,45): error TS2694: Namespace 'firebase.auth' has no exported member 'IdTokenResult'.
node_modules/angularfire2/firebase.app.module.d.ts(2,42): error TS2305: Module '"/Users/gerardtalla/dev/workspaces/ws-parcaune/pms/pms-frontend-2018/node_modules/firebase/app/index"' has no exported member 'functions'.
How can I fix that? I'm using
Angular 5
"firebase": "4.8.0"
"angularfire2": "^5.0.0-rc.5"
"#angular/cli": "~1.7.3"
if someone has an idea do not hesitate please share with me. Thank a lot in advance.
just use "angularfire2": "5.0.0-rc.5" instead of "angularfire2": "^5.0.0-rc.5"
Run the following command:
npm i --save firebase#latest angularfire2#latest
It is version compatible issue, you can read
AngularFirebase2 Changelog
5.0.0-rc.9 (2018-05-16)
auth: Adding user and idTokenResult Observables to AngularFireAuth (#1642) (31045a9)
"angularfire2": "5.0.0-rc.6",
"firebase": "4.9.0",
I resolve this issue by making this change in package.json.
mostly it is the version problem
make this change in package.json
"angularfire2": "5.0.0-rc.6",
"firebase": "4.9.0"
These should solve the problem
I fixed it with this.
"firebase": "^5.7.0",
"angularfire2": "5.0.0-rc.6",
I got the same error, remove folder in node_modules and reinstall firebase fixed my problem.
npm install --save firebase
mostly it is the version problem, check version using npm list, or try downgrade to the following the error should gone
angular: 4
angularfire2: "^5.0.0-rc.3"
firebase: "4.13.1"
Try this out
npm install --save firebase #angular/fire -f

Error: Cannot find module “mongodb” after meteor upgrade to 1.6.1.1

edit - There is something strange: mongo appears in both package.json and in .meteor/packages files (should it appear in package.json at all?? it wasn't there before the update) but in different versions. here is my package.json:
{
"name": "something",
"version": "1.1.1",
"private": true,
"scripts": {
"start": "meteor run"
},
"dependencies": {
"#babel/runtime": "^7.0.0-beta.49",
"babel-runtime": "^6.26.0",
"bootstrap": "^3.3.7",
"google-protobuf": "^3.5.0",
"grpc": "^1.12.2",
"grpc-tools": "^1.6.6",
"meteor-node-stubs": "^0.3.3",
**"mongodb": "^3.1.0-beta4",**
"react": "^16.4.0",
"react-dom": "^16.4.0",
"react-progressbar.js": "^0.2.0",
"react-router": "^3.2.1",
"react-router-dom": "^4.2.2"
}
}
and here is my .meteor/packages:
meteor-base#1.3.0 # Packages every Meteor app needs to have
mobile-experience#1.0.5 # Packages for a great mobile UX
**mongo#1.4.2 # The database Meteor supports right now**
blaze-html-templates#1.0.4 # Compile .html files into Meteor Blaze views
reactive-var#1.0.11 # Reactive variable for tracker
tracker#1.1.3 # Meteor's client-side reactive programming library
standard-minifier-css#1.4.0 # CSS minifier run for production mode
standard-minifier-js#2.3.1 # JS minifier run for production mode
es5-shim#4.7.0 # ECMAScript 5 compatibility for older browsers
ecmascript#0.10.6 # Enable ECMAScript2015+ syntax in app code
shell-server#0.3.1 # Server-side component of the `meteor shell` command
session#1.1.7
tarang:ssl
After updating to 1.6.1.1, my app won’t run, crashing with message 'Error: Cannot find module “mongodb” '.
Tried to run meteor npm install, even took away the entire node_modules folder and built it again.
Tried to run meteor npm update.
Tried to run meteor npm install mongodb.
Tried to downgrade back to version 1.6.0.1.
Still can’t find mongodb.
Important - mongodb is there, all collections are there - I can access it through the terminal with "meteor mongo".
Any help?
If it helps - The data in the db can be erased if there is no other way.
(running on ubuntu 16.04)
Thanks
In the end, the problem was not in the project but in meteor globally, so I uninstalled and re-installed meteor globally, and everything got back to normal…
Thank you all!

Resources