DEV Community

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

Collapse
madhusudanbabar profile image
Krypton

But i get this error for every single installation,
I tried with --cache to temporarily set another cache directory but still,
It happens everytime with me

Collapse
rishiabee profile image
Rishi Author • Edited on

Normally,
npm cache clean --force
solves the problem for most people.

If you scenario permits, you can consider a full uninstall of npm + delete the C:\Users{{your-username}}\AppData\Roaming\npm-cache folder.

Then re-install npm.

Finally, if nothing works for you, give yarnpkg.com/ a try.
You'll find yarn faster than npm :-)

Collapse
madhusudanbabar profile image
Krypton

Yeah,
I already switched to yarn
Thanks 😇

Thread Thread
rishiabee profile image
Rishi Author

Nice!!!
Always have a plan B :-)

Thread Thread
arrefl profile image
Ariel Reyes

How can I really switch to Yarn and avoid PACKAGE.JSON MIXING?

Thread Thread
arrefl profile image
Ariel Reyes

Ahhh Sorry. Thnks it worked.