'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"
  }
}


Solution 1:[1]

Travis exits a running build after 10 minutes if no output is printed in the logs like when you run a console.log command.

You can use travis_wait to keep it running and never closes

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

so you would replace in your scripts:

- node app.js

with

- travis_wait node app.js

Solution 2:[2]

Inside .travis.yml, replace the docker run command with below line, this will clear your road block:

docker run -e CI=true dockerusername/react-app npm run test -- --coverage

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Abdu Tawfik
Solution 2 Tyler2P