0

When I am running this command,

npm install -g @angular/cli

I am getting this error,

 npm ERR! Unexpected end of JSON input while parsing near '...npackedSize":87169,"n' 
 npm ERR! A complete log of this run can be found in:
 npm ERR! C:\Users\Krishanu\AppData\Roaming\npm-cache\_logs2018円-08-26T09_25_38_336Z-debug.log

I am on a windows system. Thing is that this was working on the linux a day before, now on linux i cannot create any app,

ng new ngapp

this command is showing the same error. I tried switching to a different network, but not working. I also tried updating the node and npm.

I am new to angular programming and I have no idea what went wrong.

SiddAjmera
39.6k7 gold badges78 silver badges114 bronze badges
asked Aug 26, 2018 at 9:36
1
  • Try —verbose flag and give the output here Commented Aug 26, 2018 at 9:38

2 Answers 2

2

This could be due to the cache, try the following,

npm cache clean --force

and then do

ng new app
answered Aug 26, 2018 at 9:37
Sign up to request clarification or add additional context in comments.

Comments

1

use => npm update --save with administrator permission

answered Aug 26, 2018 at 9:45

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.