Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

travis: sh: 0: Can't open /etc/init.d/xvfb

Tags:

My travis CI uses Ubuntu 14.04 and Node.js 8. My .travis.yml looks like:

language: node_js node_js:   - 8 sudo: required addons:     chrome: stable before_script:   - export DISPLAY=:99.0   - sh -e /etc/init.d/xvfb start install:   - npm set progress=false   - npm install script:   - ng lint   - npm run test   - npm run e2e   - npm run build 

I've tried to update it to use Ubuntu 16.04 and Node.js 10 by changing it to:

language: node_js node_js:   - '10' dist: xenial sudo: required addons:     chrome: stable before_script:   - export DISPLAY=:99.0   - sh -e /etc/init.d/xvfb start install:   - npm set progress=false   - npm install script:   - ng lint   - npm run test   - npm run e2e   - npm run build 

However now I'm getting error when trying to start xvfb:

0.00s$ sh -e /etc/init.d/xvfb start

sh: 0: Can't open /etc/init.d/xvfb

The command "sh -e /etc/init.d/xvfb start" failed and exited with 127 during .

like image 643
Francesco Borzi Avatar asked Apr 14 '19 11:04

Francesco Borzi


1 Answers

The solution was to remove sh -e /etc/init.d/xvfb start from the before_script array and simply introduce xvfb in the services array.

So my .travis.yml now looks like this:

language: node_js node_js:   - '10' dist: xenial sudo: required services:   - xvfb addons:     chrome: stable before_script:   - export DISPLAY=:99.0 install:   - npm set progress=false   - npm install script:   - ng lint   - npm run test   - npm run e2e   - npm run build 
like image 166
Francesco Borzi Avatar answered Oct 05 '22 09:10

Francesco Borzi