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)
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
firebase-tools-instant-win.exe
file tofirebase-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:I tried to upgrade
but I can’t install as x64 is not supported.
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
It is working for me now.
firebase -V
: 11.25.1node -v
: v18.15.0renaming
firebase-tools-instant-win.exe
file tofirebase-win.exe
worked for me.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: