npm ERR! Unexpected end of JSON input while parsing
Solution 1
You do not need to uninstall or install anything. Just
npm cache clean --force
and then
npm install
will do.
Solution 2
In the folder where you have tried to create project setup, just run these 2 commands:
npm cache clean --force
npm install
Afterwards, run the commands needed to setup your project directory.
Solution 3
This issue was solved by going to C:\Users\USERNAME\AppData\Roaming\npm-cache and deleting its contents manually , then later running cmd as Administrator and running npm install
Solution 4
open the cmd in adminstator mode then run the following commands in order specify
npm cache clean --force
go in the c:/user/user_name/AppData/Roaming/npm => clean this folder
npm install -g @angular/cli
ng new project_name
Hope it will work.
Related videos on Youtube
Comments
-
Abhimanyu over 2 years
Got the following error while executing
ng new project-name
in angular projectnpm WARN deprecated [email protected]: CircularJSON is in maintenance only, flatted is its successor.
npm ERR! Unexpected end of JSON input while parsing near '...:"~0.0.0","webpack-de'npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Abhi\AppData\Roaming\npm-cache_logs\2018-12-13T10_24_02_151Z-debug.log
Package install failed, see above.What I have tried :
1. npm cache clean --force
2. npm cache verify
3. npm ERR! Unexpected end of JSON input while parsing near '...5.0","rimraf":"^2.2.8'Current Versions:
Node : 10.14.2
NPM : 6.5.0
OS : Windows-
Abhishek over 5 yearshave try this
npm uninstall -g angular-cli npm cache clean
after thatnpm install -g angular-cli
after that try -
Abhimanyu over 5 years@Abhishek Getting same error while installing angular-cli
-
Patrick Hollweck over 5 yearsPost your
package.json
file -
Abhimanyu over 5 years@PatrickHollweck I am new to Angular.Can you please tell me where can find that file?
-
-
xskxzr about 5 yearsWhat's the difference from other existing answers?
-
Myth about 5 yearsYou do not need to uninstall or install anything just
npm cache clean --force
and thennpm install
will do