Getting this error:
Error: Local workspace file ('angular.json') could not be found.
I noticed that after updating angular cli, my existing project started giving this error. Error: Local workspace file ('angular.json') could not be found.
This is complete error
Error: Local workspace file ('angular.json') could not be found.
at WorkspaceLoader._getProjectWorkspaceFilePath (E:\PROJECT\MyProjects\NewAngDemoAppWithRoute\node_modules\@angular\cli\models\workspace-loader.j
s:44:19)
at WorkspaceLoader.loadWorkspace (E:\PROJECT\MyProjects\NewAngDemoAppWithRoute\node_modules\@angular\cli\models\workspace-loader.js:31:21)
at ServeCommand._loadWorkspaceAndArchitect (E:\PROJECT\MyProjects\NewAngDemoAppWithRoute\node_modules\@angular\cli\models\architect-command.js:18
9:32)
at ServeCommand.<anonymous> (E:\PROJECT\MyProjects\NewAngDemoAppWithRoute\node_modules\@angular\cli\models\architect-command.js:55:25)
at Generator.next (<anonymous>)
at E:\PROJECT\MyProjects\NewAngDemoAppWithRoute\node_modules\@angular\cli\models\architect-command.js:14:71
at new Promise (<anonymous>)
at __awaiter (E:\PROJECT\MyProjects\NewAngDemoAppWithRoute\node_modules\@angular\cli\models\architect-command.js:10:12)
at ServeCommand.initialize (E:\PROJECT\MyProjects\NewAngDemoAppWithRoute\node_modules\@angular\cli\models\architect-command.js:54:16)
at Object.<anonymous> (E:\PROJECT\MyProjects\NewAngDemoAppWithRoute\node_modules\@angular\cli\models\command-runner.js:90:23)
This issue is faced because of mismatch of angular cli version. In older versions file "angular-cli.json" was used for configuration purpose in angular project but angular cli version 6.1.1 used "angular.json" file for configuration. Just run below command.
ng update @angular/cli
It will update your cli version and problem resolves.