2
votes

Got the following error while executing ng new project-name in angular project

npm 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

5
have try this npm uninstall -g angular-cli npm cache clean after that npm install -g angular-cli after that tryAbhishek
@Abhishek Getting same error while installing angular-cliAbhimanyu
Post your package.json filePatrick Hollweck
@PatrickHollweck I am new to Angular.Can you please tell me where can find that file?Abhimanyu

5 Answers

15
votes

You do not need to uninstall or install anything. Just

npm cache clean --force

and then

npm install

will do.

4
votes

In the folder where you have tried to create project setup, just run these 2 commands:

  1. npm cache clean --force
  2. npm install

Afterwards, run the commands needed to setup your project directory.

2
votes

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

1
votes

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.

0
votes
delete node_modules folder
delete package-lock.json 
npm clear -f cache
npm i