title: Cypress & Jenkins: Install system dependency "xvfb" via Jenkinsfile
body: <p>To run Cypress, it requires that system dependencies be installed, <a href="https://docs.cypress.io/guides/guides/continuous-integration.html#Dependencies" rel="nofollow noreferrer">Cypress Dependencies</a></p>
  <pre><code>apt-get install libgtk2.0-0 libgtk-3-0 libnotify-dev 
  libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb
  </code></pre>
  <p>To run Cypress script in local Jenkins, I am creating a <strong><code>Jenkinsfile</code></strong>.</p>
  <p>Jenkinsfile has a stage command <code>npx cypress run</code> in Jenkins, and it fails <code>&quot;Your system is missing the dependency: Xvfb&quot;</code>.</p>
  <p>First thought was to install <a href="https://www.npmjs.com/package/xvfb" rel="nofollow noreferrer">npm package xvfb</a>, and that did not resolve the problem.</p>
  <p>Then, I installed through local Jenkins, <a href="https://plugins.jenkins.io/xvfb/" rel="nofollow noreferrer">Jenkins plugin Xvfb</a>, and this worked!</p>
  <p>My goal is to run Cypress on a remote Jenkins, and it fails the same way <code>&quot;Your system is missing the dependency: Xvfb&quot;</code>.</p>
  <p><strong>Important note:</strong> I do not have access to remote Jenkins service and command <strong>Manage Plugins</strong> to request install of <a href="https://plugins.jenkins.io/xvfb/" rel="nofollow noreferrer">Jenkins plugin Xvfb</a>.</p>
  <p>Since it was not clear how to install <a href="https://plugins.jenkins.io/xvfb/" rel="nofollow noreferrer">Jenkins plugin Xvfb</a> through <code>Jenkinsfile</code>, I tried shell scripting within <code>Jenkinsfile</code>. Each system package appear to install except <code>xvfb</code>, so this approach of install to remote Jenkins service did not work.</p>
  <pre><code>sh 'sudo apt-get install libgtk2.0-0 libgtk-3-0 
  libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 
  libxtst6 xauth xvfb -y'
  </code></pre>
  <p>Is anyone aware to script <code>Jenkinsfile</code> to install <a href="https://plugins.jenkins.io/xvfb/" rel="nofollow noreferrer">Jenkins plugin Xvfb</a> before running npm installs?</p>
  <p>Thank you, much appreciate your assistance</p>