Travis build is hanging waiting for user input (To install angular)

点点圈 提交于 2019-12-02 00:00:40

问题


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.



来源:https://stackoverflow.com/questions/56363203/travis-build-is-hanging-waiting-for-user-input-to-install-angular

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!