Unexpected end of JSON input while parsing...

Unexpected end of JSON input while parsing...

I am going to fix vulnerabilities by run the command npm audit fix but meet an error:

1
2
3
4
npm ERR! Unexpected end of JSON input while parsing near '...g/backbone/-/backbone'

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/lolimay/.npm/_logs/2019-11-06T17_40_28_140Z-debug.log

It's was so frustrated because I have no idea how to solve the problem. The only way for me is to google it.

Then I found a feasible solution:

1
npm cache clean --force

After cleaning the npm's cache, everything goes well. The nice day comes back 😄