Open source software supply chain lighting plan, waiting for you>>>
The following error was reported when running ng serve
Local workspace file ('angular.json') could not be found.
Error: Local workspace file ('angular.json') could not be found.
at WorkspaceLoader._getProjectWorkspaceFilePath (D:\nodejs\node_global\node_modules\@angular\cli\models\workspace-loader.js:44:
19)
at WorkspaceLoader.loadWorkspace (D:\nodejs\node_global\node_modules\@angular\cli\models\workspace-loader.js:31:21)
at ServeCommand._loadWorkspaceAndArchitect (D:\nodejs\node_global\node_modules\@angular\cli\models\architect-command.js:201:32)
at ServeCommand.<anonymous> (D:\nodejs\node_global\node_modules\@angular\cli\models\architect-command.js:53:25)
at Generator.next (<anonymous>)
at D:\nodejs\node_global\node_modules\@angular\cli\models\architect-command.js:7:71
at new Promise (<anonymous>)
at __awaiter (D:\nodejs\node_global\node_modules\@angular\cli\models\architect-command.js:3:12)
at ServeCommand.initialize (D:\nodejs\node_global\node_modules\@angular\cli\models\architect-command.js:52:16)
at Object.<anonymous> (D:\nodejs\node_global\node_modules\@angular\cli\models\command-runner.js:127:23)
Error reason: it may be caused by the mismatch between angular/cli version and project
Solution:
Upgrade angular/cli
1. Unload angular/cli globally
npm uninstall -g @angular/cli
2. Clean up
npm cache verify
3. Install angular/cli globally
npm install -g @angular/cli@latest
4. Uninstall anguar/cli in the project path
npm uninstall --save-dev @angular/cli
5. Install under the project path:
npm install --save-dev @angular/[email protected]
6. NPM install or yarn install under the project path
7. Fix the problem after NPM installation:
npm audit fix
8. Solve the problems related to “angular. JSON”:
ng update @angular/cli --migrate-only --from=1.4.9