首页 > 解决方案 > Travis CI build failed because of no output

问题描述

I am new to CI/CD tools. I have made CI/CD pipeline using travis CI. But my build is failed and it is giving me the following error :

No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.

So , basically build timed out because no output was received. What kind of output it is expecting?

.travis.yml file :

language: node_js
node_js:
  - 10

script:
- node app.js

Screenshot of the Travis build : enter image description here

package.json

{
  "name": "seatmgmt",
  "version": "1.0.0",
  "description": "",
  "main": "app.js",
  "scripts": {
    "start": "node app.js"
  },
  "repository": {
    "type": "git",
    "url": "SeatManagement"
  },
  "author": "SJ",
  "license": "MIT",
  "dependencies": {
    "express": "^4.17.1",
    "socket.io": "^3.0.4"
  }
}

标签: node.jsbuildcontinuous-integrationtravis-ci

解决方案


如果在运行console.log命令时没有在日志中打印输出,Travis 会在 10 分钟后退出正在运行的构建。

您可以使用travis_wait它来保持运行并且永不关闭

https://docs.travis-ci.com/user/common-build-problems/#build-times-out-because-no-output-was-received

所以你会在你的脚本中替换:

- node app.js

- travis_wait node app.js


推荐阅读