firebase-tools icon indicating copy to clipboard operation
firebase-tools copied to clipboard

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

Open crowne opened this issue 3 years ago • 5 comments

[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

>

crowne avatar May 31 '21 08:05 crowne

This issue does not have all the information required by the template. Looks like you forgot to fill out some sections. Please update the issue with more information.

google-oss-bot avatar May 31 '21 08:05 google-oss-bot

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

mightyfrog avatar Sep 26 '21 18:09 mightyfrog

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.

lokenjon avatar Jun 02 '22 17:06 lokenjon

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

swavkulinski avatar Jul 20 '22 13:07 swavkulinski

Happening to me even if installed on C drive.

jeremyhalin avatar Oct 14 '22 14:10 jeremyhalin

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

jasonw4331 avatar Nov 04 '22 02:11 jasonw4331

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.

mediocre9 avatar Nov 22 '22 16:11 mediocre9

I'm also getting this issue. The .exe is installed on the C drive and I renamed it to firebase-win.exe but still no success. I also tried to delete the firebase folder created in C:\Users\{MYPROFILENAME}\.cache and run again but no effect. Any other solutions found to this error? I'm using flutter and not node.js so trying to avoid the npm route...


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

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

jacisback avatar Mar 13 '23 03:03 jacisback

hello @jacisback, the renaming solution did work for me, but after the update I got the same error. I know that you want to avoid the nodejs approach, but installing it through npm was the real fix for me.

mediocre9 avatar Mar 13 '23 20:03 mediocre9

Guys, I simply put the EXE literally in the C folder and worked. Try that.

KaioSantos32 avatar Mar 23 '23 12:03 KaioSantos32

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 [email protected]: 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

jea-ms avatar Mar 26 '23 08:03 jea-ms

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

pavelsg avatar Mar 30 '23 07:03 pavelsg

With the firebase_win_instant.exe name, how does dart know about that name? When I execute "flutterfire configure" it fails to find "firebase.exe," of course!

sidprice avatar May 26 '23 20:05 sidprice

@sidprice I've ended up installing it using Node.js path

pavelsg avatar May 27 '23 05:05 pavelsg

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

Seems there may be no choice.

sidprice avatar May 27 '23 14:05 sidprice

I renamed the file to firebase_win_instant.exe in drive C in any folder and it seems to work(Just login. Didn't try something else yet.) . This is super annoying. Is there a chance this will be fixed soon?

Firebase version: 12.4.8

RandallFlagg avatar Aug 22 '23 00:08 RandallFlagg

@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!

tmilker avatar Sep 03 '23 19:09 tmilker

I faced this error multiple times today. The file was on c:, but it seems antivirus software Avast was messing with it (quarantine, renaming file to include ~-character). When deactivating antivirus and downloading anew, the issue disappeared.

Mercutio1243 avatar Jan 31 '24 08:01 Mercutio1243