updating firebase using expo client - firebase

I am working on a react native app, I use firebase, I recently updated expo, and when I use this command expo start, everything works but I get this message on the logs:
Some of your project's dependencies are not compatible with currently installed expo package version:
- firebase - expected version range: 7.9.0 - actual version installed: ^8.2.0 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 install [package-name ...] Starting Metro Bundler
when use expo install firebase i get the following error:
Installing 1 SDK 37.0.0 compatible native module using Yarn.
> yarn add firebase#7.9.0
'yarnpkg' is not recognized as an internal or external command,
operable program or batch file.
spawn yarnpkg ENOENT
Error: spawn yarnpkg ENOENT
how can I correctly update firebase?

first do
npm install yarn -g
after that is complete
then do
yarn add firebase#7.9.0

Related

Multiple Versions of Firebase Installed - Which Do I Use?

I'm trying to build an app with Firebase and ran a few commands to see which version I have. To follow along with a 2021 instruction video, I was hoping to have Firebase v9. Depending on the command that I run, I somehow have versions 8 and 11. If I have these two versions, which one is actually being used? What is the difference between seemingly having an npm firebase and non-npm firebase installed?
armadillo#armadillo-MacBook-Air my-app % npm firebase --version
8.11.0
armadillo#armadillo-MacBook-Air my-app % firebase -V
11.2.2
If you're trying to work with the Firebase CLI, you should be looking at the firebase-tools npm package, not firebase. They are definitely not the same thing.
npm firebase-tools --version
I suggest reviewing the documentation as well.
As covered by #Doug's answer, the firebase command is defined by the firebase-tools npm package (or by https://firebase.tools if installed that way) not the firebase package, which does not define any command line utilities.
Additionally, npm --version returns the version of npm you have installed. This includes if you add the name of a package there. (i.e. npm thisCouldBeAnythingNotANPMCommand --version will return the same result)
If you want to view the version of a deployed package, you would use one of the following commands to query NPM's database:
npm view firebase version (view package's "version" field)
npm v firebase version (view package's "version" field, using shorthand)
npm view firebase (get all available package information)
If you want to view the version of a package installed in your project or globally, you would use:
npm ls firebase (local install)
npm ls -g firebase-tools (global install)
If you want to view the where the npm-installed commands are, you would use:
npm bin (local install)
npm bin -g (global install)
For the firebase command, the firebase/firebase.cmd/firebase.ps1 files all point to <global bin directory>/node_modules/firebase-tools/lib/bin/firebase.js.
Compare the results of:
> npm v firebase version
9.9.0
> npm ls firebase
`-- firebase#9.0.0-beta.6 (an old project directory for another SO answer)
> npm v firebase-tools version
11.2.2
> npm ls -g firebase-tools
`-- firebase-tools#9.21.0 (updated since :D)
> npm --version
6.4.12
> npm firebase --version
6.4.12
> npm v npm version
8.14.0 (updated since :D)

How to fix the error: "No Next.js version could be detected in your project." when deploying to Vercel with Turborepo and pnpm

I am trying to deploy the Turborepo example app to Vercel using instructions from here, and getting the error:
Error: No Next.js version could be detected in your project. Make sure `"next"` is installed in "dependencies" or "devDependencies"
How can I fix it?
Docs says that the build command npm install --prefix=../.. is only required if using npm workspaces, and doesn't apply when using pnpm or yarn workspaces. Since am using pnpm, I replace npm install --prefix=../.. with pnpm i -r and it worked.

Unable to login Firebase with cli command

I'm trying to login to my Firebase account with cli command firebase login. I believe it should open browser and prompt me to login with my google account, but that doesn't seem to happen.
Instead, it's asking me to enter my email and password in the terminal. Once I enter my credentials, it throws the following error:
/usr/lib/node_modules/firebase-cli/node_modules/source-map-support/source-map-support.js:223
return '\n at ' + wrapCallSite(frame);
^ TypeError: CallSite method toString expects CallSite as receiver
How do I fix this as I want to deploy my app to Firebase?
I've had the same issue.
You're probably using firebase-cli instead of firebase-tools.
https://firebase.google.com/docs/cli#update-cli
firebase-cli has been deprecated years ago.
#mikeonline did you ever installed the Firebase tools/cli before on
your machine (before we launched v3 at Google IO) basically did you
have v2.2 previously installed perhaps?
firebase-cli has been deprecated a year ago and only installs v1. NPM
should have printed this message"
npm WARN deprecated firebase-cli#1.2.0: Use firebase-tools instead.
Both v2 and v3 can be installed with npm install -g firebase-tools but
by default the latest version (3.0.0) gets installed.
https://github.com/firebase/codelab-friendlychat-web/issues/22#issuecomment-220695413
Execute the below command
npm uninstall firebase-cli
npm uninstall firebase-tools
npm install -g firebase-tools --force

How to connect SQLite3 with Electron (Win10)

I'm trying to connect my Electron project with SQLite3 but I'm encountering an error that say's
An unhandled error occurred inside electron-rebuild
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". [E:\Personal_Projects\myquiz\node_modules\sqlite3\build\deps\action_before_build.vcxproj]
I've followed these steps:
1. install electron-rebuild (npm install --save-dev electron-rebuild)
2. install sqlite3 using npm (npm install --save sqlite3)
I've already found the solution just download and install the SDK 8.1 version.

Firebase config variables are not available error with deploying functions

When I am deploying Firebase functions without
admin.initializeApp(functions.config().firebase);
Firebase logs
Error: The default Firebase app does not exist. Make sure you call
initializeApp() before using any of the Firebase services.
But if I add that line I get error on deploy.
>firebase deploy --only functions
Error:
Error: Error occurred while parsing your function triggers. Please
ensure you have the latest firebase-functions SDK by running "npm i
--save firebase-functions#latest" inside your functions folder.
Error: Firebase config variables are not available. Please use the
latest version of the Firebase CLI to deploy this function.
I already did npm i --save firebase-functions#latest which haven't done anything. I am stuck and can't do anything right now because of this... I am down for any reinstalls if they could help just tell me some steps or hints and I would seek for the rest.
NPM and NodeJS versions are:
node -v
v8.9.1
npm -v
5.6.0
Edit. Installation with admin rights:
npm i --save firebase-functions#latest
npm WARN firebase-functions#0.8.1 requires a peer of firebase-admin#~5.8.1 but none is installed. You must install peer dependencies yourself.
npm ERR! path C:\Users\Telion\firebaseApps\project-name\functions\node_modules\firebase-admin\node_modules\grpc\node_modules\abbrev
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\Telion\firebaseApps\project-name\functions\node_modules\firebase-admin\node_modules\grpc\node_modules\abbrev' -> 'C:\Users\Telion\firebaseApps\project-name\functions\node_modules\firebase-admin\node_modules\grpc\node_modules\.abbrev.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
It actually appeared I was on npm version 5.5.1 but even after the update to 5.6.0 I got the exact same error.
There was a breaking change introduced in firebase-tools#3.17.x which requires your project to upgrade firebase-functions to the latest version.
However, firebase-functions#latest also requires firebase-admin#latest (at the time of writing this answer firebase-admin#5.11.0. Once all packages are upgraded, this problem should be solved.
Another alternative is to downgrade your global firebase-tools to 3.16.0, which lets you use older firebase-functions and firebase-admin packages.
I ran into the same issue in Ubuntu and this is how i solved it
Install firebase using : sudo npm install -g firebase-tools
Also make sure you launch using admin privileges e.g to login
sudo firebase login
You also need to update the node to at least 8.15.x. That detail is shown in the message.
Once I intalled that I had to do a firebase login command and after that you can run the firebase init hosting
Previously I was getting the error on firebase init hosting but after that node update, it went away.
Hope it helps.
For me, it worked for firebase-tools6.9.2.
The firebase-tools3.16.0 is completely depricated.

Resources