firebase-tools: "SyntaxError: Unexpected end of JSON input" appears on startup of firebase-tools-instant-win.exe

[REQUIRED] Environment info

firebase-tools: 9.12.0

Platform: OS Name - Microsoft Windows 10 Pro Version - 10.0.19042 Build 19042

[REQUIRED] Test case

Download firebase-tools-instant-win.exe from https://firebase.tools/bin/win/instant/latest The run the .exe

[REQUIRED] Steps to reproduce

[REQUIRED] Expected behavior

Normal startup

[REQUIRED] Actual behavior

########################################################################################################################

     Welcome to...
   ######## #### ########  ######## ########     ###     ######  ########  ##
   ##        ##  ##     ## ##       ##     ##  ##   ##  ##       ##        ##
   ######    ##  ########  ######   ########  #########  ######  ######    ##
   ##        ##  ##    ##  ##       ##     ## ##     ##       ## ##
   ##       #### ##     ## ######## ########  ##     ##  ######  ########  ##


########################################################################################################################

~ 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:315:20)
    at maybeClose (internal/child_process.js:1021:16)
    at Socket.<anonymous> (internal/child_process.js:443:11)
    at Socket.emit (events.js:315:20)
    at Pipe.<anonymous> (net.js:674:12)

> firebase --version
9.12.0

>

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 6
  • Comments: 18 (1 by maintainers)

Most upvoted comments

This happens if you put firebase-tools-instant-win.exe in other than C: drive.

How many hundred of thousands of developers will download TO THE D DRIVE (not C) and run firebase-tools-instant-win.exe only for the installation to fail without a meaning full error message. At least put in a warning statement that the exe file should be placed on the C drive before running. Took me hours of hair-pulling to register a flutter project.

lol, the damn thing just seems to remember it’s executable name was on the first start (i.e. firebase-win-instant.exe), so after I have renamed it to firebase.exe (expected by dart) and moved to other folder it fails on startup with this weird JSON error. So after renaming it back to what it was on the first start (firebase-win-instant.exe) it is able to start w/o failure. I have left it in the other folder, so path doesn’t seems to matter (haven’t tried it outside of C: drive though).

Happening to me even if installed on C drive.

I also have the same issue. I already did

  • deleting the firebase folder created in C:\Users{MYPROFILENAME}.cache
  • putting exe to C:\firebase\bin
  • renaming firebase-tools-instant-win.exe file to firebase-win.exe

But still can’t use firebase. So I installed it using npm: npm install -g firebase-tools -f After that there is still an error:

Firebase CLI v11.25.1 is incompatible with Node.js v14.17.3 Please upgrade Node.js to version ^14.18.0 || >=16.4.0

I tried to upgrade

npm cache clean -f npm install -g n

but I can’t install as x64 is not supported.

npm ERR! code EBADPLATFORM npm ERR! notsup Unsupported platform for n@9.0.1: wanted {“os”:“!win32”,“arch”:“any”} (current: {“os”:“win32”,“arch”:“x64”}) npm ERR! notsup Valid OS: !win32 npm ERR! notsup Valid Arch: any npm ERR! notsup Actual OS: win32 npm ERR! notsup Actual Arch: x64

So I just downloaded the installer from their site: download link Installed it on my C drive. Now i can run this from powershell: firebase login

i Firebase optionally collects CLI and Emulator Suite usage and error reporting information to help improve our products. > Data is collected in accordance with Google’s privacy policy (https://policies.google.com/privacy) and is not used to identify you. ? Allow Firebase to collect CLI and Emulator Suite usage and error reporting information? Yes i To change your data collection preference at any time, run firebase logout and log in again. Visit this URL on this device to log in:

It is working for me now.

firebase -V: 11.25.1 node -v: v18.15.0

Issue persists in 11.16.0 consistently when exe placed outside C:/ drive.

#####################################################################################################################################
     Welcome to...
   ######## #### ########  ######## ########     ###     ######  ########  ##
   ##        ##  ##     ## ##       ##     ##  ##   ##  ##       ##        ##
   ######    ##  ########  ######   ########  #########  ######  ######    ##
   ##        ##  ##    ##  ##       ##     ## ##     ##       ## ##
   ##       #### ##     ## ######## ########  ##     ##  ######  ########  ##


#####################################################################################################################################
~ 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 (node:events:527:28)
    at maybeClose (node:internal/child_process:1092:16)
    at Socket.<anonymous> (node:internal/child_process:451:11)
    at Socket.emit (node:events:527:28)
    at Pipe.<anonymous> (node:net:709:12)

> firebase --version
11.16.0

renaming firebase-tools-instant-win.exe file to firebase-win.exe worked for me.

@pavelsg Thanks, I was trying to avoid having to install another package I would rarely use 😦

Seems there may be no choice.

I fixed this by adding:

Set-Alias -Name firebase -Value firebase-tools-instant-win.exe

to my Powershell profile with firebase-tools-instant-win.exe in my path. This lets me run flutterfire within the Firebase CLI. Joke’s on me though because flutterfire doesn’t support the windows platform so I can’t use it anyway!

This issue resurfaced in 11.2.2 but then gone in 11.3.0. It was happening when installed on drive C: