Trying to run puppeteer tests on CircleCI (StencilJS project) result in an error where it seems like it can’t find libXtst
. I had no problems running this same command on Travis:
[ ERROR ] Failed to launch chrome!
/home/circleci/project/node_modules/puppeteer/.local-chromium/linux-662092/chrome-linux/chrome:
error while loading shared libraries: libXtst.so.6: cannot open
shared object file: No such file or directory TROUBLESHOOTING:
https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md
Error: Failed to launch chrome!
/home/circleci/project/node_modules/puppeteer/.local-chromium/linux-662092/chrome-linux/chrome:
error while loading shared libraries: libXtst.so.6: cannot open
shared object file: No such file or directory TROUBLESHOOTING:
https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md
at onClose
(/home/circleci/project/node_modules/puppeteer/lib/Launcher.js:342:14)
at Interface.helper.addEventListener
(/home/circleci/project/node_modules/puppeteer/lib/Launcher.js:331:50)
at Interface.emit (events.js:203:15) at Interface.close
(readline.js:397:8) at Socket.onend (readline.js:173:10) at
Socket.emit (events.js:203:15) at endReadableNT
(_stream_readable.js:1129:12) at process._tickCallback
(internal/process/next_tick.js:63:19)
And here’s my config.yml
(with the jobs that were running fine removed):
version: 2.1
defaults: &defaults
docker:
- image: circleci/node:10.16.0
environment:
- NODE_ENV: development # CircleCI needs devDeps
commands:
# npm install
setup:
steps:
- checkout
- restore_cache:
keys:
- node_modules-{{ checksum "package.json" }}
- node_modules-
- run: npm install
- save_cache:
paths:
- node_modules
key: node_modules-{{ checksum "package.json" }}
- run: npm run prepare-docs
# Lint & test
test:
<<: *defaults
steps:
- setup
- run: npm run lint && npm test
workflows:
version: 2
# Normal workflow for untagged PRs
untagged:
jobs:
- test
Edit: this seems to be related to missing dependencies on Linux, at least according to the Puppeteer troubleshooting guide. This problem seems to be unique to CircleCI; I’m running the exact same Puppeteer command on Travis with no problem. How do I go about installing a missing dependency from a CircleCI image?