1

I am very new to Angular. I have installed the Angular by using the command:

npm install -g @angular/cli

When I check the version of Angular it shows:

enter image description here

After on, I installed an Angular application by using: ng new newApp

I have got an error during app installation:

Unexpected end of JSON input while parsing near '...//registry.npmjs.org/'

Here is the image of what I have done:

enter image description here

You can find log content through this link: https://drive.google.com/file/d/11MEWOcSaU4c-1879LuijRiXRvCu-cAIz/view?usp=sharing

Let me know where is the problem...

5
  • try to create a new project, again. Commented Dec 24, 2018 at 18:34
  • @Yoarthur I have tried it many times in different directories. But no any success... Commented Dec 24, 2018 at 18:38
  • 1
    delete the folder and all it's content, and try it again. Commented Dec 24, 2018 at 18:43
  • 1
    @RahmatAli clear npm cache using npm cache clean and then try creating a new application Commented Dec 24, 2018 at 18:45
  • @MohsinMehmood This trick worked for me. I have used npm cache clean --force and now it installed the new application. Buddy Thanks : )... Commented Dec 24, 2018 at 18:52

1 Answer 1

4

Try clearing the npm cache first using the following command and then try creating a new ng application

npm cache clean --force
Sign up to request clarification or add additional context in comments.

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.