The following error was reported while 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 cause: Possible angular/ CLI version mismatch
Solutions:
Upgrade presents/cli
Uninstall Angular/CLI globally
npm uninstall -g @angular/cli
2. Clean up
npm cache verify
Install Angular/CLI globally
npm install -g @angular/cli@latest
4. Uninstall Angluar/CLI under 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. Resolve “Angular. Json” related issues:
ng update @angular/cli --migrate-only --from=1.4.9
Reproduced in: https://www.cnblogs.com/shira-t/p/9759142.html
Read More:
- Unable to read workspace file ‘D:\angular.json‘: Invalid JSON character: “ “ at
- 【ipfs-api】npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.
- Angular Error You seem to not be depending on “@angular/core“ and/or “rxjs“. (Fixed)
- When angular4.0 starts the project, an error is reported: the “@ angular / compiler cli” package was not properly installed
- Solve angular’s cannot find module ‘@ angular devkit / core’ problem
- Some projects cannot be imported because they already exist in the workspace
- MySQL server PID file could not be found!
- but “catkin_make“ must be invoked in the root of workspace
- When NPM install, make: G + +: command not found will be prompted
- vs2013 wdk8.1 ERROR: Symbol file could not be found. Defaulted to export symbols for ntkrnlmp.exe
- Vs2017 reported an error. Pthread. H header file cannot be opened and cannot be found
- WCF-HTTP Error 404.17 – Not Found, The requested content appears to be script and will not be served…
- About error CSC in c# vs: error cs0006: metadata file could not be found
- Configuration file for vscode setting.json UI interface or JSON form
- Error reading JSON file: json.decoder.JSONDecodeError : Extra data: line 6 column 2 (char 1329)
- Type error: the JSON object must be STR, bytes or byte array, not ‘textiowrapper’
- tensorflow import error: DLL load failed: The specified module could not be found (DLL load failed: The specified module could not be found)
- Eclipse startup error: an error has occurred.See the log file E:\workspace\.metadata\.log.
- scalac: Token not found: C:\Users\User\AppData\Local\JetBrains\IntelliJIdea2020.3\compile-server\to
- Securityerror: error ᦇ 2148: SWF file XXX cannot access local resources, only file system only