Error: Local workspace file ('angular.json') could not be found
I was getting the same error messages. It was a silly mistake on my end, I was not running ng serve
in the directory where my Angular project is. Make sure you are in the correct directory (project directory) before running this command.
With recent version, without --migrate-only
I got the repo updated.
I did ng update
The Angular CLI configuration format has been changed, and your existing configuration can be updated automatically by running the following command:
ng update @angular/cli
Updating karma configuration
Updating configuration
Removing old config file (.angular-cli.json)
Writing config file (angular.json)
Some configuration options have been changed, please make sure to update any npm scripts which you may have modified.
DELETE .angular-cli.json
CREATE angular.json (3684 bytes)
UPDATE karma.conf.js (1040 bytes)
UPDATE src/tsconfig.spec.json (322 bytes)
UPDATE package.json (1340 bytes)
UPDATE tslint.json (3140 bytes)
I just had the same problem.
It's related to release v6.0.0-rc.2, https://github.com/angular/angular-cli/releases:
New configuration format. The new file can be found at angular.json (but .angular.json is also accepted). Running ng update on a CLI 1.7 project will move you to the new configuration.
I needed to execute:
ng update @angular/cli --migrate-only --from=1.7.4
This removed .angular-cli.json
and created angular.json
.
If this leads to your project using 1.7.4, install v6 locally:
npm install --save-dev @angular/[email protected]
And try once again to update your project with:
ng update @angular/cli --migrate-only --from=1.7.4