-1

I am a Front End Developer facing a problem in running an Angular app in Visual Code.

I have created an app in Angular 5.0 with latest node.js package and npm package.

Angular 5.0 App Error

C:\my-app\AngularDemo>ng new myFirstApp You cannot use the new command inside an Angular CLI project.

Can you please find a solution as soon as possible?

Stephen Kennedy
  • 20,585
  • 22
  • 95
  • 108
Kusumakar Pant
  • 187
  • 1
  • 2
  • 14
  • 2
    So you created an Angular project, and you're trying to create another Angular project INSIDE your Angular project? Why? What are you trying to accomplish? The error is pretty straight forward. You can't create a new Angular project inside of another Angular project. – Jun Kang Apr 05 '18 at 18:20
  • The question remains the same. Please read the statements as depicted in the figure. – Kusumakar Pant Apr 05 '18 at 18:38
  • What question? The only question in your post is "Can you please find a solution as soon as possible?" There is no solution. You can't create a new Angular project in the directory of an existing Angular project. Hence my question, what are you actually trying to accomplish? If you want to create another Angular project, create it in an empty directory, not inside an existing Angular project. Are you trying to serve the project? If you are, you're using the wrong command, and need to use `ng serve` instead. – Jun Kang Apr 05 '18 at 18:55
  • Sorry Jun Kang [https://stackoverflow.com/users/8062101/jun-kang], but I needed a descriptive explanation with examples as given by Yassine Ben Hamida [https://stackoverflow.com/users/7570811/yassine-ben-hamida] Sorry and Thanks – Kusumakar Pant Apr 05 '18 at 19:04
  • I wasn't trying to answer your question. I was trying to get more information from you, so that I could BETTER answer your question, because your question didn't make sense. But as long as you found a solution, whatever. Good luck with learning Angular. – Jun Kang Apr 05 '18 at 19:06

1 Answers1

1

You cannot create an angular project while you're situated in another.

you can leave your current directory and create another, then type in the angular-cli

ng new projectname

My guess is that you want to generate a component in your project, to do so you have to type ng generate component mycomponentname.

you can check out these links for more informations :

https://github.com/angular/angular-cli

https://angular.io/guide/quickstart