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
Similar Posts:
- How to Solve ReferenceError: internalBinding is not defined
- [Solved] Module build failed: Error: Cannot find module ‘node-sass’
- NPM Install vue-cli Error: internal/modules/cjs/loader.js (Error: Cannot find module ‘D:\Program\nodejs\node_global\node_modules\vue-cli\bin\vue’)
- jenkins+sonar-scanner Scan Error: Failed to find ‘typescript’ module.Please check, NODE_PATH contains location of global ‘typescript’ or install locally in your project
- Module build failed: TypeError: this.getResolve is not a function at Object.loader node-sass Install Error
- [Solved] Vue installs less Error: Failed to compile with 1 errors
- Cannot find module ‘../lib/utils/unsupported.js’
- Angular Project Download Error: [ERROR] ionic-app-scripts has unexpectedly closed (exit code 1).
- Completely Uninstall Node.js from Mac OS X
- NPM err installation dependency package error [How to Solve]