npm ERR! Unexpected token < in JSON at position 12842

Deleting the package-lock.json didn't work for me. The issue was an extra comma in my package.json file.

Try copying your json file into jsonlint.com. It will give you more information to show you if the issue you're having is truly a syntax error.

Checkout this article https://dev.to/redslug/7-solutions-to-ejsonparse-or-unexpected-token-npm-install-error-20nh if none of the answers here help. It helped me.


It's because of a package-lock.json merge conflict.

Delete the file, delete node_modules, and run npm install to solve the problem:

rm package-lock.json
rm -rf node_modules
npm install

try to remove package.lock file

Possible issue here

Tags:

Npm

Angular