Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop angular cli asking for collecting analytics when I use ng build

Angluar CLI is asking the following question when I am trying to build and deploy my project using gitlab CI/CD:

> @angular/[email protected] postinstall /workspace/node_modules/@angular/cli  > node ./bin/postinstall/script.js    ? Would you like to share anonymous usage data with the Angular Team at Google u  nder  Google’s Privacy Policy at https://policies.google.com/privacy? For more details   and  how to change this setting, see http://angular.io/analytics. (y/N) 

Of course I cannot input anything in the CI/CD pipeline. How can I can prevent angular cli from asking this question?

like image 857
Arman Fatahi Avatar asked May 29 '19 07:05

Arman Fatahi


People also ask

Would you like to share anonymous usage data with the angular team at Google under?

You might be prompted to share anonymous usage data with the Angular Team at Google under Google's Privacy Policy, I usually like to opt out. It is totally up to you. If you would like to share data, type y and hit enter. Otherwise type N.

How do I uninstall angular CLI globally?

We will use the following command to uninstall Angular CLI like this: npm uninstall -g @angular/cli.


1 Answers

I had the same problem: The new analytics feature of Angular CLI was blocking my CI: https://travis-ci.org/LVM-IT/lvo-logging-lib. Solution: set the environent variable NG_CLI_ANALYTICS equal to ci

export NG_CLI_ANALYTICS=ci 

see: https://github.com/LVM-IT/lvo-logging-lib/blob/329d014aa34dea49522f036e8d0b3aa3f71e33e7/.travis.yml#L16

Link to ng-cli Analytics

like image 88
Dirk Lammers Avatar answered Sep 20 '22 13:09

Dirk Lammers