5

While CircleCI build, in the processes of executing sudo npm install -g @angular/cli Google asked to share anonymous data usage yes/no question. How can I avoid prompt of that question in CircleCI ?

Image of docker is circleci/node:8 Command run: sudo npm install -g @angular/cli

Error message:

#!/bin/bash -eo pipefail

sudo npm install -g @angular/cli

/usr/local/bin/ng -> /usr/local/lib/node_modules/@angular/cli/bin/ng @angular/cli@8.0.1 postinstall /usr/local/lib/node_modules/@angular/cli node ./bin/postinstall/script.js ? Would you like to share anonymous usage data with the Angular Team at Google under 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) ?

Would you like to share anonymous usage data with the Angular Team at Google under 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) ?

Would you like to share anonymous usage data with the Angular Team at Google under 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) Too long with no output (exceeded 10m0s)

This question is about CircleCI build and this is not a solution for me. I can't get this solution implemented in CircleCI.

Community
  • 1
  • 1
Sasitha Iresh
  • 397
  • 1
  • 5
  • 14
  • 1
    Possible duplicate of [Travis build is hanging waiting for user input (To install angular)](https://stackoverflow.com/questions/56363203/travis-build-is-hanging-waiting-for-user-input-to-install-angular) – halfer Jun 06 '19 at 13:34
  • I believe not because it doesn't solve the issue. [here](https://github.com/angular/angular-cli/issues/14619) – Sasitha Iresh Jun 07 '19 at 01:07
  • @halfer can you please remove the duplicate marker. – Sasitha Iresh Jun 07 '19 at 01:23
  • This looks like an _exact_ duplicate, Sasitha. Don't be put off by the fact that you're using Circle and the other one is for Travis - the error is the same, and I would expect the solution there to work too. If the issue is different (as per your answer) then would you edit the question to explain why it is different - did you try it? – halfer Jun 07 '19 at 07:07
  • Note that on Stack Overflow, claiming something is different does not make it different. Your additional note in the question says "it is not a solution" and that you "can't get it implemented" could do with some expansion (at least, if you want to help differentiate these questions). – halfer Jun 07 '19 at 07:11

2 Answers2

15

You can let your angular know that it's being built in CI by defining environmental variable NG_CLI_ANALYTICS=ci. Or just disable usage analytics question completely with NG_CLI_ANALYTICS=false.

Refer to angular-cli/docs/design/analytics.md:Disabling Usage Analytics for more information.

Filipp Shestakov
  • 651
  • 7
  • 17
  • It's the best solution. However in my project, I have specified which version of Angular to use. If version is below Angular 8 then all good. Thanks for the reply. – Sasitha Iresh Aug 22 '19 at 05:07
0

I was able to solve the issue by making few changes.

  1. New angular-cli@8 does not support node@8. So I change my code to npm install -g @angular/cli to npm install -g @angular/cli@7.3.9

  2. Also at the end of the line > /dev/null part was added. npm install -g @angular/cli@7.3.9 > /dev/null

Sasitha Iresh
  • 397
  • 1
  • 5
  • 14