npm install firebase error

Following npm error occurred while installing firebase in a React native project:

npm ERR! Unexpected end of JSON input while parsing near '...QJE/lmJ9+1uAb8A92m7xO'

Unable to proceed, everytime installation finishes with this error.

Can anyone help me understand and resolve this issue?

Thanks.

Can you attach the log file?

Here is the log file.

2019-08-18T03_27_39_172Z-debug.log (82.1 KB)

I was able to install both @firebase/functions-types@0.3.8 and @firebase/messaging-types@0.3.2 without problems (the two packages with errors in the logs).

Is the problem still happening? (I am wondering if it was a bad network connection and a corrupt transfer.)

Yes. The error still persists. No internet connection issue.

I write this command in VS code terminal: npm install firebase.

Is there any issues with this command, or something elseโ€ฆ???

I am able run npm install firebase without getting those errors (on macOS).

I am not sure whether a bad cache could cause this, but easy to run a verify:

npm cache verify

And although in theory not needed these days, easy to clear too if you want to eliminate cache corruption as a possibility!

npm cache clean --force

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.