DEV Community

Discussion on: npm ERR! Unexpected end of JSON input while parsing near

Collapse
 
thealjey profile image
Eugene Kuzmenko • Edited

It doesn't help. It's dumb to suggest for people to clean their cache every time.
The --force flag is there for a reason. It's giving you the option, while at the same time trying to persuade you not to do it.
What I wish is for some of these articles to suggest a way to identify the failing package.
Because the npm error logs are less than useless in this regard.
It needs to print the url it was trying to fetch, and not just say that it failed to parse some abstract json, coming from God only knows where.
On any decently sized project there are hundreds of packages.
Many companies use proxy servers for npm.
An attempt to load a package can fail for a multitude of reasons.

Collapse
 
davidakinjames profile image
Akinwande Akin-James

So what do you sugggest?

Collapse
 
thealjey profile image
Eugene Kuzmenko

I am, honestly, yet to find a good solution for this.
The problem is not so much with this article as it is with npm itself.
Just use yarn if you can 😀

Thread Thread
 
davidakinjames profile image
Akinwande Akin-James • Edited

Its all good