OneBite.Dev - Coding blog in a bite size

Solve Unexpected end of JSON input while parsing near... on NPM install

Yesterday when my internet really slow, I keep failed on installing npm package. The error shows npm ERR! Unexpected end of JSON input while parsing near .....

Yesterday when my internet really slow, I keep failed on installing npm package. The error shows npm ERR! Unexpected end of JSON input while parsing near …’

npm cache clean --force

So when the internet back at the speed again, I just clean the npm cache, then reinstall the package I want

npm