Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The new command requires to be run outside of a project, but a project definition was found at

Tags:

angular

I get the following error when trying to create a component: ng n c test

error: The new command requires to be run outside of a project, but a project definition was found at he new command requires to be run outside of a project, but a project definition was found at "C:\Users\User\Desktop\project\basics-assignment-2-start\angular.json".

like image 526
user12599720 Avatar asked Dec 26 '19 08:12

user12599720


1 Answers

You are trying to create a new workspace and new angular application Check cli commands here

new n

Creates a new workspace and an initial Angular app.

You are already in an angular application so the cli just tells you that you can't do it.

If you are trying to generate a new component (as I think you are, try ng g c test in your angular project. Beware that the component will be created relatively to the position you are currently at.

like image 152
Athanasios Kataras Avatar answered Oct 11 '22 15:10

Athanasios Kataras