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即可正常工作:
要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":
總結
以上是生活随笔為你收集整理的Angular应用ng build的一些边界情况boundary condition的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: SAP Spartacus的Angula
- 下一篇: 今天是中国传统节日“重阳节”。也是爷爷的