I'm getting the following error after an npm audit fix --force
(I know, I know).
The build command requires to be run in an Angular project, but a project definition could not be found.
I'm guessing that I need a project.json
file however I can't find a template (or documentation) for that.
Extracts from my package.json
:
"dependencies": {
"@angular/animations": "^5.0.3",
"@angular/common": "^5.0.3",
"@angular/compiler": "^5.0.3",
"@angular/core": "^5.0.3",
"@angular/forms": "^5.0.3",
"@angular/http": "^5.0.3",
"@angular/platform-browser": "^5.0.3",
"@angular/platform-browser-dynamic": "^5.0.3",
"@angular/router": "^5.0.3",
"devDependencies": {
"@angular/cli": "^7.2.3", <-- previously 1.5.4
"@angular/compiler-cli": "^5.0.3",
(can post full file if needed)
Credit to @dmoore1181 and @Edric for pointing out that the missing file was indeed angular.json
and that an upgrade was needed.
Following the advice in this question, I completed the upgrade but still didn't have an angular.json
- what did this for me in the end (and also mentioned in the answer to that question) was the following command:
ng update @angular/cli --from=1.7.4 --migrate-only
Create a new project with ng new
and that should create the file you need. Then you can copy it over to your project.
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