0

I have a project that was created a long time back without using Angular CLI tools. Recently, I've been trying to look at improving load performance within my app, and I wanted to see if I can use the optimization tools under CLI, so I installed it with npm. When trying to run the command "ng build" I get the following error: The build command requires to be run in an Angular project, but a project definition could not be found.

Does Angular CLI require the app to be created under the tool? I've been using package.json to define my angular app, but I see mentions of using angular.json for cli, do I need to modify the package.json file? Is there a way I can support the CLI module under my app?

1

1 Answer 1

2

The easiest method is to use Angular CLI to create a brand new application by running ng new your-app-name. Migrate your packages over to the newly generated package.json file. Delete the app module that was generated and use your existing app module.

Sign up to request clarification or add additional context in comments.

1 Comment

Yeah, I've been researching that and it looks like my only go-to solution at the moment. Unfortunately, I created this app when I was new to Angular, so there are a lot of configuration steps I need

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.