Travis build is hanging waiting for user input (To

2020-04-10 02:06发布

问题:

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

回答1:

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.



回答2:

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.