3

When building the app with Travis, the build hangs after it tries to install angular. It does this by waiting for input.

I have gone through the docs which show that this is indeed the case when "Waiting for keyboard input or other kind of human interaction". But I get no option of doing this anywhere. My .travis.yml is up to date and does what is expected.

My .yml code

language: node_js
node_js:
  - "11.0"
sudo: required
branches:
  only:
    - master
before_script:
  - npm install -g --silent firebase-tools
  - npm install -g @angular/cli
script:
  - npm install
  - ng build --prod
deploy:
  skip_cleanup: true
  provider: firebase
  token:
    secure: "1/St7DD3G1QTmK-hdghJoK4cS348_bxklRqbuM3t7KGuE"

after_success:
  - firebase deploy --token "1/St7DD3G1QTmK-hdghJoK4cS348_bxklRqbuM3t7KGuE" --non-interactive

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) No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself. Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received The build has been terminated

TrevorBrooks
  • 3,590
  • 3
  • 31
  • 53
Bjorn Liza
  • 109
  • 1
  • 11

2 Answers2

2

You need add this in your .travis.yml file:

before_script:
  - export NG_CLI_ANALYTICS=ci

You can find here a online sample ready for use.

Stéphane GRILLON
  • 11,140
  • 10
  • 85
  • 154
  • 1
    It appears that this environment variable is actually documented in the analytics documentation file: https://github.com/angular/angular-cli/blob/master/docs/design/analytics.md#disabling-usage-analytics (It also states that setting the env variable to `ci` will set analytics for CIs, but actually turns off analytics) – Edric Jun 06 '19 at 14:46
0

Change in your Travis file

from: npm install -g @angular/cli to: es | npm install -g @angular/cli

This sends one "yes" to the NPM install command.

halfer
  • 19,824
  • 17
  • 99
  • 186