angular-cli

NG Build fails in Azure Pipelines with NPM error 134

隐身守侯 提交于 2020-01-14 13:36:10
问题 Approx 50% of my hosted builds are failing with npm error 134. I am building the same commit with the same build definition using hosted vs2017. I am building an Angular Application using the Angular CLI. The npm task calls 'run build' which is defined as "ng build --prod" in my package.json. Both a successful build and failed build are using npm task version 1.1.49 and npm verion 6.8. This leads me to believe it is something related to the hosted environment. The hosted vs2017 and vs2019

How to resolve test.ts when running ng test?

烈酒焚心 提交于 2020-01-14 10:09:20
问题 I'm using Angular CLI and when I run ng test , it starts launching the browser, then I suddenly get an error: userName@UserName:~/devApp/profiles$ng test 10% building modules 1/1 modules 0 active18 09 2017 16:16:51.891:WARN [karma]: No captured browser, open http://localhost:9876/ 18 09 2017 16:16:51.903:INFO [karma]: Karma v1.7.0 server started at http://0.0.0.0:9876/ 18 09 2017 16:16:51.903:INFO [launcher]: Launching browser Chrome with unlimited concurrency 18 09 2017 16:16:51.915:INFO

How to resolve test.ts when running ng test?

ε祈祈猫儿з 提交于 2020-01-14 10:08:12
问题 I'm using Angular CLI and when I run ng test , it starts launching the browser, then I suddenly get an error: userName@UserName:~/devApp/profiles$ng test 10% building modules 1/1 modules 0 active18 09 2017 16:16:51.891:WARN [karma]: No captured browser, open http://localhost:9876/ 18 09 2017 16:16:51.903:INFO [karma]: Karma v1.7.0 server started at http://0.0.0.0:9876/ 18 09 2017 16:16:51.903:INFO [launcher]: Launching browser Chrome with unlimited concurrency 18 09 2017 16:16:51.915:INFO

Implementation of Proxy Server in Angular4-5

懵懂的女人 提交于 2020-01-14 07:02:31
问题 Problem Statement: Client/UI developed using angular-cli and Angular-5, UI is running on http://localhost:4200 and we have back-end server running on http://localhost:8000 that means all api's called like http://localhost:8000/users/getuserinfo and returns some json data properly. Also having other routes like http://localhost:8000/student/getresult etc. So i have to create proxy for this as when i run ng serve my application open-up in browser on http://localhost:4200, but while making call

determining the unused Angular modules at the app.module.ts file

杀马特。学长 韩版系。学妹 提交于 2020-01-13 09:06:50
问题 I've inherited an angular app that imports everything under the sun causing the vendor.bundle.js to be 8mb. Is there a utility to let me know which modules are not in use, and can safely be removed? Or does the AOT takes care of that? Also, do I need to remove the node_modules folder if there is no import related to it? Or is it that it would not hurt to leave it there cause AOT won't take it anyway? 回答1: As far as I know, AOT only removes code that isn't used or imported into an NgModule .

How to force Angular cli to serve the bundle files from an absolute location rather then base-href

醉酒当歌 提交于 2020-01-13 06:00:52
问题 I'm struggling with deploying Angular 4 project built with cli to a Spring boot server. In the .angular-cli.json I added outdir property, which points to a custom folder inside Spring webapp folder, which is accessible directly in the server (webapp/main). The cli build command I'm using is: ng build --base-href /main/ -a main Which creates the main folder in the webapp, with the index.html containing the following script tags: <base href="/main/"> ... <script type="text/javascript" src=

Angular 6 - Serving different index files depending on the environment

余生长醉 提交于 2020-01-13 02:10:52
问题 I have a local environment and a production environment. Within the index.html i add or remove script files depending on if the environment is local or production. I want an easy way to handle this. Inside the angular.json there is a file_replacement configuration option. This works for switching out the environment.ts to an environment.prod.ts but it does not seem to work for replacing the index.html file to a index.prod.html . { "$schema": "./node_modules/@angular/cli/lib/config/schema.json

Angular 6 - Serving different index files depending on the environment

假装没事ソ 提交于 2020-01-13 02:10:12
问题 I have a local environment and a production environment. Within the index.html i add or remove script files depending on if the environment is local or production. I want an easy way to handle this. Inside the angular.json there is a file_replacement configuration option. This works for switching out the environment.ts to an environment.prod.ts but it does not seem to work for replacing the index.html file to a index.prod.html . { "$schema": "./node_modules/@angular/cli/lib/config/schema.json

The “@angular/compiler-cli” package was not properly installed

时光怂恿深爱的人放手 提交于 2020-01-12 20:20:23
问题 Upgrading my project to Angular 4.0 (from 2.4) with Angular CLI 1.0 (from beta.31), I get the error below after following the migration guide: > ng build --prod The "@angular/compiler-cli" package was not properly installed. Error: The "@angular/compiler-cli" package was not properly installed. at Object.<anonymous> (/home/jan/src/fm-repos/fm-ui/node_modules/@ngtools/webpack/src/index.js:14:11) at Module._compile (module.js:571:32) at Object.Module._extensions..js (module.js:580:10) at Module

The “@angular/compiler-cli” package was not properly installed

牧云@^-^@ 提交于 2020-01-12 20:20:21
问题 Upgrading my project to Angular 4.0 (from 2.4) with Angular CLI 1.0 (from beta.31), I get the error below after following the migration guide: > ng build --prod The "@angular/compiler-cli" package was not properly installed. Error: The "@angular/compiler-cli" package was not properly installed. at Object.<anonymous> (/home/jan/src/fm-repos/fm-ui/node_modules/@ngtools/webpack/src/index.js:14:11) at Module._compile (module.js:571:32) at Object.Module._extensions..js (module.js:580:10) at Module