I am trying to update firebase to the lastest version and encountered an error. That pointed me to the functions-emulator having an issue:

$ npm install @google-cloud/functions-emulator
npm ERR! Unexpected end of JSON input while parsing near '..."retry-request":"^4.0'

This happens after the recent update on firebase. Am I doing something wrong or is this bug I should report?

Tried multiple solutions including a complete de-install of npm, node and even vsc. Updating npm, trying to install the cloud functions emulator specifically...always the same error in some dependency file.

Here's the error log

88 error Unexpected end of JSON input while parsing near '..."retry-request":"^4.0'

I was just looking to update firebase to the latest version. Now everything is broken :D

Any help is much appreciated.

1 Answers

1
Rob On Best Solutions

Error occurred due to a corrupted file download (tried installing a firebase update on the train).

Solved with:

npm cache clean --force

Then re-installed package.