Axe-cli in GitLab CI

I’m trying to use axe-cli in GitLab CI to run a basic scan against a remote website after a deploy. The job keeps throwing an error.

My job configuration looks like this:

axe:
  stage: scan
  image: buildkite/puppeteer
  script:
    - npm install -g axe-cli --unsafe-perm
    - axe $URL

Everything seems to work fine until I try to invoke axe, which gives me this error:

Running axe-core 3.3.2 in chrome-headless

/usr/local/lib/node_modules/axe-cli/node_modules/selenium-webdriver/lib/promise.js:2626
        throw error;
        ^

WebDriverError: unknown error: Chrome failed to start: exited abnormally
  (unknown error: DevToolsActivePort file doesn't exist)
  (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
  (Driver info: chromedriver=77.0.3865.40 (f484704e052e0b556f8030b65b953dce96503217-refs/branch-heads/[email protected]{#442}),platform=Linux 3.10.0-1062.el7.x86_64 x86_64)
    at Object.checkLegacyResponse (/usr/local/lib/node_modules/axe-cli/node_modules/selenium-webdriver/lib/error.js:546:15)
    at parseHttpResponse (/usr/local/lib/node_modules/axe-cli/node_modules/selenium-webdriver/lib/http.js:509:13)
    at doSend.then.response (/usr/local/lib/node_modules/axe-cli/node_modules/selenium-webdriver/lib/http.js:441:30)
    at process._tickCallback (internal/process/next_tick.js:68:7)
From: Task: WebDriver.createSession()
    at Function.createSession (/usr/local/lib/node_modules/axe-cli/node_modules/selenium-webdriver/lib/webdriver.js:769:24)
    at Function.createSession (/usr/local/lib/node_modules/axe-cli/node_modules/selenium-webdriver/chrome.js:761:15)
    at createDriver (/usr/local/lib/node_modules/axe-cli/node_modules/selenium-webdriver/index.js:170:33)
    at Builder.build (/usr/local/lib/node_modules/axe-cli/node_modules/selenium-webdriver/index.js:642:16)
    at startDriver (/usr/local/lib/node_modules/axe-cli/lib/webdriver.js:37:26)
    at testPages (/usr/local/lib/node_modules/axe-cli/lib/axe-test-urls.js:11:10)
    at Object.<anonymous> (/usr/local/lib/node_modules/axe-cli/index.js:136:1)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)

I’m not sure if I’ve misconfigured something or if buildkite/puppeteer is just the wrong tool for this job. Any thoughts?

Source: StackOverflow