how to solve Firebase CLI error on start up
Asked Answered
C

11

28

when I open firebase CLI I get this error :

 Let's make sure your Firebase CLI is ready...
undefined:1



SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at ChildProcess.<anonymous> (C:\snapshot\firepit\welcome.js:115:27)
    at ChildProcess.emit (events.js:311:20)
    at maybeClose (internal/child_process.js:1021:16)
    at Socket.<anonymous> (internal/child_process.js:443:11)
    at Socket.emit (events.js:311:20)
    at Pipe.<anonymous> (net.js:668:12)

enter image description here

I am using windows 10 pro

Casimiracasimire answered 20/5, 2020 at 22:1 Comment(4)
If you have a bug to report, post that in the Firebase CLI github. github.com/firebase/firebase-toolsEncratia
I am not sure if it's a bug. it's my first time to use firebase CLICasimiracasimire
I got the same error. Copying firebase-tools-instant-win.exe to any folder on drive C: worked but not on any other drive. No ideea why.Coast
This happens for me when I run it directly from the Downloads directory on C: drive.Quintal
V
28

The comment on the original question was the solution for me. My "Downloads" folder is hosted on D: and the installer assumes C:

(how to solve Firebase CLI error on start up)

Vascular answered 4/2, 2021 at 12:2 Comment(1)
Exactly, I just moved firebase_cli to C drive and it worked :)Hux
G
18

A solution that helped me after transferring the exe to C has failed, is deleting the folder:

C:\Users\{YOUR_PROFILE_NAME}\.cache\firebase

Hope this helps anyone

Glasgow answered 25/8, 2021 at 17:18 Comment(4)
indeed it helped, thank you :)Jasperjaspers
It didn't help me :(Quintal
I deleted the firebase folder but this same error is comingCeja
A corrupt install of Firebase CLI was uninstalled through this. I had downloaded the binary of firebase tools to begin with but my computer shut down before it could finish due to a bluescreenofdeath. BTW the corruption caused the same error msg as in this question!Tragedian
I
12

That is nothing to worry about, it only appears because the CLI by default assumes it is in the C directory.

So, copying the CLI exe to any other directory would show this message but, you can still use all the CLI functionalities as you wish.

Like what I did here using firebase init

Firebase CLI

Intercolumniation answered 11/12, 2021 at 22:15 Comment(0)
S
8

The solution :


leave the exe name as: "firebase-win.exe" and you can move it to whatever folder you want




The detailed explanation:


i moved the executable i downloaded ("firebase-tools-instant-win.exe") to folder: c:\firebase\bin and it works without any error,

but for some reason if i rename the exe file to something like: "firebase.exe" or "fbcli.exe" it will throw the json error and will not download the .cache folder correctly

but if i rename the exe name to: "firebase-win.exe" it works no matter what folder i put it in,

when checking C:\Users{YOUR_PROFILE_NAME}.cache\firebase\runtime\shell.bat

if the exe name is: "firebase.exe" (Not working) then the content is:

@echo off
"C:\firebase\bin\firebase.exe"  C:\Users\{YOUR_PROFILE_NAME}\CACHE~1\firebase\runtime\shell.js %*

if the exe name is: "firebase-win.exe" (working) then the content is:

@echo off
"C:\firebase\bin\FIREBA~1.EXE"  C:\Users\shaybc\.cache\firebase\runtime\shell.js %*

so i simply left the exe name: "firebase-win.exe"

valid names worked for me:

  1. fireb-win.exe
  2. firebase-win.exe
  3. firebase-w.exe
  4. fire-base.exe
  5. fbcli-win.exe
  6. ...
Shakira answered 1/10, 2022 at 12:13 Comment(1)
Strange! But it worked.Staats
S
3

It worked for me when i downloaded firebase-tools-win.exe instead of firebase-tools-instant-win.exe from https://github.com/firebase/firebase-tools/releases even after renaming it.

Sparry answered 25/8, 2023 at 17:32 Comment(0)
G
1

leave the exe name as: "firebase-win.exe" and you can move it to whatever folder you want worked for me when in C drive

Gotten answered 23/3, 2023 at 14:2 Comment(0)
B
1

copy firebase-tools-instant-win to c: drive and execute

Bartie answered 13/8, 2023 at 11:43 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Tertial
H
0

Install Firebase using npm:

npm install firebase

source: https://firebase.google.com/docs/web/setup

Hypozeuxis answered 16/12, 2021 at 9:42 Comment(1)
You are assuming the original question had access to node, which may not have been the case.Endoblast
T
0

I faced the same error. What helped me is to rename it back to the original name :firebase-tools-instant-win.exe. Previously I renamed it to firebase.exe, it seems that this caused the problem for me.

Tanning answered 3/7, 2023 at 17:26 Comment(0)
K
0

None above helped (neither to move from drive D to C nor binary file rename), but I deleted %USER_PROFILE%/.cache/firebase instead.

Kalpa answered 3/5 at 9:16 Comment(0)
C
-2

I got this warning as well, but when I tried to init, serve, and deploy, it worked just fine. Good luck!

Carter answered 28/6, 2020 at 3:53 Comment(1)
Hi, try posting this as a comment instead of an answer. If you want to answer the question, provide more substance.Bosco

© 2022 - 2024 — McMap. All rights reserved.