Firebase-js-sdk: SyntaxError: Unexpected end of JSON input while parsing near '...se/webchannel-wrapper'

Created on 26 Jun 2018  路  5Comments  路  Source: firebase/firebase-js-sdk


Describe your environment

  • Operating System version: Windows 10
  • Firebase SDK version: Latest

Describe the problem

I ran npm install --save and got the error below:
SyntaxError: Unexpected end of JSON input while parsing near '...se/webchannel-wrapper'

// TODO(you): code here to reproduce the problem
needs-triage

Most helpful comment

I ran npm cache clean --force and then npm i firebase.

Everything is fine now

All 5 comments

Hey there! I couldn't figure out what this issue is about, so I've labeled it for a human to triage. Hang tight.

Hmmm this issue does not seem to follow the issue template. Make sure you provide all the required information.

I ran npm cache clean --force and then npm i firebase.

Everything is fine now

Duplicate of #768. Please search for similar issues before opening an issue.

npm cache's claim:

All data that passes through the cache is fully verified for integrity on both insertion and extraction. Cache corruption will either trigger an error, or signal to pacote that the data must be refetched, which it will do automatically. For this reason, it should never be necessary to clear the cache for any reason other than reclaiming disk space, thus why clean now requires --force to run.

The npm cache is strictly a cache: it should not be relied upon as a persistent and reliable data store for package data. npm makes no guarantee that a previously-cached piece of data will be available later, and will automatically delete corrupted contents. The primary guarantee that the cache makes is that, if it does return data, that data will be exactly the data that was inserted.

But based on several issues (pretty common I guess), npm cache's "corruption-proof" seem to be just assumptions, not reality. :'(

Was this page helpful?
0 / 5 - 0 ratings