2

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

4
  • have try this npm uninstall -g angular-cli npm cache clean after that npm install -g angular-cli after that try Commented Dec 13, 2018 at 10:42
  • @Abhishek Getting same error while installing angular-cli Commented Dec 13, 2018 at 10:46
  • Post your package.json file Commented Dec 13, 2018 at 10:55
  • @PatrickHollweck I am new to Angular.Can you please tell me where can find that file? Commented Dec 13, 2018 at 10:59

6 Answers 6

15

You do not need to uninstall or install anything. Just

npm cache clean --force

and then

npm install

will do.

Sign up to request clarification or add additional context in comments.

2 Comments

What's the difference from other existing answers?
You do not need to uninstall or install anything just npm cache clean --force and then npm install will do
4

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.

Comments

2

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

Comments

1

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.

Comments

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

Comments

0

You need to delete package-lock.json and try installing again.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.