Answers for "npm ERR! Unexpected end of JSON input while parsing near '...2","gulp-mocha":"^2.1' npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Dell\AppData\Roaming\npm-cache\_logs\2020-07-20T08_48_51_212Z-debug.log"

8

npm ERR! Unexpected end of JSON input while parsing near '...r\nComment: https://o'

npm cache clean --force
npm install -g @angular/cli
Posted by: Guest on March-28-2020
5

error Unexpected end of JSON input while parsing near '...

This is not a definitive answer but it looks like your global packages are corrupted in some way.

This bug may be caused by many different things. I suggest doing the following.

1 Install Node Version Manager (or NVM for Windows) and install Node version 10.16.1. This is enough for angular 9 and from my experience it is the most stable version for development. This should also change your NPM version so that may also help.
2 Uninstall global angular package npm uninstall -g @angular/cli
3 Force clear cache npm cache clean --force
4 Just to double check npm cache verify
5 You can also try clearing your %temp% and %roaming% AppData/npm-cache
6 install latest angular package npm install -g @angular/cli@<your-version>
7 if this error still occurs, consider using another shell

If this don't solve the problem try to manually locate the package.json file that is throwing an error and investigate.
Posted by: Guest on May-08-2020

Code answers related to "npm ERR! Unexpected end of JSON input while parsing near '...2","gulp-mocha":"^2.1' npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Dell\AppData\Roaming\npm-cache\_logs\2020-07-20T08_48_51_212Z-debug.log"

Code answers related to "Javascript"

Browse Popular Code Answers by Language