You are trying to create a new angular, react, vue app, and you end up with an error message saying:
npm ERR! Unexpected end of JSON input while parsing near
There's a high chance that your npm cache been damaged.
Try:
npm cache clean --force
If you are a windows user, try deleting all files in this folder:
C:\Users{{your-username}}\AppData\Roaming\npm-cache
Then...
npm cache verify
If that doesn't work, try updating to the lastest (understand the risks)
npm i npm@latest -g
I hope this helps!


Latest comments (45)
Worked for me thanks
This helps
i had also struggled with this error and this and i have solved this error by using running the command
npm installin an adminstrator terminal and it worked on ubuntu osI use Angular and I don't see solutions for it. Please help me
Thank you, al work like Hero. I did not know so much cache for npm. thanks.
It's working. Thanks, a lot for this easy way to solve this problem. May Allah bless you brother.
I'm on windows. Clearing my cache and then deleting files in the folder above worked for me. Thanks!
It was the only thing that worked.
Thanks.
first run
npm i -g create-react-appthen it will update and remove some package in this directly to
Nice!!! Thanks Ankush.
Thanks alot. I had issues installing gulp-cli, this solution fixed it