DEV Community

Luteya Coulston
Luteya Coulston

Posted on • Edited on

Fixing "Unexpected token \u0000 in JSON at position.." error

I had this error while creating a react app but most of the solutions I found didn't solve the error and I thought I should write this for future reference.

You have to clean cache for the error to go away as it's corrupt. The following are ways of doing it inside a terminal.
For npm:

npm cache verify
Enter fullscreen mode Exit fullscreen mode

If it still doesn't work try:

npm cache clean --force
Enter fullscreen mode Exit fullscreen mode

For yarn:

yarn cache clean
Enter fullscreen mode Exit fullscreen mode

Top comments (0)