出现错误:
Local workspace file ('angular.json') could not be found.
Error: Local workspace file ('angular.json') could not be found.
at WorkspaceLoader._getProjectWorkspaceFilePath (C:\Users\Administrator\AppData\Roaming\npm\node_modules\@angular\cli\models\workspace-loader.js:44:19)
at WorkspaceLoader.loadWorkspace (C:\Users\Administrator\AppData\Roaming\npm\node_modules\@angular\cli\models\workspace-loader.js:31:21)
at ServeCommand._loadWorkspaceAndArchitect (C:\Users\Administrator\AppData\Roaming\npm\node_modules\@angular\cli\models\architect-command.js:201:32)
at ServeCommand.<anonymous> (C:\Users\Administrator\AppData\Roaming\npm\node_modules\@angular\cli\models\architect-command.js:53:25)
at Generator.next (<anonymous>)
at C:\Users\Administrator\AppData\Roaming\npm\node_modules\@angular\cli\models\architect-command.js:7:71
at new Promise (<anonymous>)
at __awaiter (C:\Users\Administrator\AppData\Roaming\npm\node_modules\@angular\cli\models\architect-command.js:3:12)
at ServeCommand.initialize (C:\Users\Administrator\AppData\Roaming\npm\node_modules\@angular\cli\models\architect-command.js:52:16)
at Object.<anonymous> (C:\Users\Administrator\AppData\Roaming\npm\node_modules\@angular\cli\models\command-runner.js:127:23)
解决办法:
ng update @angular/cli --migrate-only --from=1.7.4
npm install --save-dev @angular/cli@v6.0.0-rc.4
ng update @angular/cli --migrate-only --from=1.7.4
安装之后又出现了这个错误:
Package require os(darwin) not compatible with your platform(win32)
然后再执行
npm update
npm install
nodejs node_modules/node-sass/scripts/install.js
npm rebuild node-sass