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".
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With