pm ERR! Unexpected end of JSON input while parsing near '...lR15Rg8\nF+9ko1ICH8 code example
Example 1: npm ERR! Unexpected end of JSON input while parsing near '...ty":"sha512-2GTXt3b2Q'
npm cache clean --force
Example 2: Unexpected end of JSON input while parsing near
Open Windows Powershell as admin
npm cache clean --force
solved the problem for me
Alternative : You can use yarn instead
npm install -g yarn