Angular应用ng build的一些边界情况boundary condition

ng build报错:no projects support the build target

究其原因,发现angular.json architect里的build被改成build2了:

直接用ng build2是不行的,因为ng help得到的参数列表里,根本没有ng build2这个选项。

ng serve执行的输出:

An unhandled exception occurred: Error: ENOENT: no such file or directory, lstat 'C:/Code/SPA/sandbox/tsconfig.app1.json'
at Object.lstatSync (fs.js:1007:3)
at NodeJSFileSystem.lstat (C:\Code\SPA\sandbox\node_modules@angular\compiler-cli\src\ngtsc\file_system\src\node_js_file_system.js:55:23)
at calcProjectFileAndBasePath (C:\Code\SPA\sandbox\node_modules@angular\compiler-cli\src\perform_compile.js:126:31)
at Object.readConfiguration (C:\Code\SPA\sandbox\node_modules@angular\compiler-cli\src\perform_compile.js:144:22)
at Object.readTsconfig (C:\Code\SPA\sandbox\node_modules@angular-devkit\build-angular\src\angular-cli-files\utilities\read-tsconfig.js:25:29)
at Object.configureI18nBuild (C:\Code\SPA\sandbox\node_modules@angular-devkit\build-angular\src\utils\i18n-options.js:97:38)
at Object.generateI18nBrowserWebpackConfigFromContext (C:\Code\SPA\sandbox\node_modules@angular-devkit\build-angular\src\utils\webpack-browser-config.js:85:57)
at Object.buildBrowserWebpackConfigFromContext (C:\Code\SPA\sandbox\node_modules@angular-devkit\build-angular\src\browser\index.js:67:41)
at setup (C:\Code\SPA\sandbox\node_modules@angular-devkit\build-angular\src\dev-server\index.js:103:63)

See "C:\Users\I042416\AppData\Local\Temp\ng-L9wtWB\angular-errors.log" for further details.




将tsConfig属性指定的无效的tsconfig.app.json路径纠正,ng serve即可正常工作:



你可能感兴趣的:(Angular应用ng build的一些边界情况boundary condition)