Remon Shehatta
Remon Shehatta

Reputation: 1470

how to solve Firebase CLI error on start up

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

Upvotes: 30

Views: 19813

Answers (11)

Alexander Enaldiev
Alexander Enaldiev

Reputation: 76

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

Upvotes: 0

Gaya Limane
Gaya Limane

Reputation: 41

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.

Upvotes: 4

Guillermo Guzman
Guillermo Guzman

Reputation: 11

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

Upvotes: 1

Anthonio
Anthonio

Reputation: 76

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.

Upvotes: 1

Ynot
Ynot

Reputation: 11

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

Upvotes: 1

Shaybc
Shaybc

Reputation: 3147


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. ...

Upvotes: 8

Frank GP
Frank GP

Reputation: 11

Install Firebase using npm:

npm install firebase

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

Upvotes: 0

Mostafa Wael
Mostafa Wael

Reputation: 3838

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

Upvotes: 13

MightySarion
MightySarion

Reputation: 331

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

Upvotes: 18

CoreyH
CoreyH

Reputation: 534

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)

Upvotes: 29

marv
marv

Reputation: 1

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

Upvotes: -2

Related Questions