title: Error using yarn install / can't answer a question unless a user TTY
body: <p>I'm using <code>yarn</code> on <strong>Debian Stretch (4.9.168)</strong>, having a Jenkins installed and trying to run <code>yarn install --no-progress --flat --network-timeout=1000000</code> out of my Jenkinsfile.</p>
  
  <p><code>yarn</code> has been installed via Global Configuration for Node.JS on Jenkins (<code>npm install -g yarn@latest</code>), but as soon as the Jenkinsfile tries to run the above mentions install command, I get the following error:</p>
  
  <pre><code>+ yarn install --no-progress --flat --network-timeout=1000000
  yarn install v1.19.1
  [1/4] Resolving packages...
  error An unexpected error occurred: "Can't answer a question unless a user TTY".
  info If you think this is a bug, please open a bug report with the information provided in "/data/jenkins/workspace/REPONAME_PR-1-head/yarn-error.log".
  info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
  script returned exit code 1
  </code></pre>
  
  <p>So apparently yarn has been installed correctly. A bit of search brought some information for Windows, but not how to fix it for Linux. Does anyone have any clue how to fix this problem?</p>
  
  <p>Jenkinsfile looks like this:</p>
  
  <pre><code>#!/usr/bin/env groovy
  pipeline {
    agent {
      label 'linux'
    }
  
    tools {
      nodejs "NodeJS_v11.9.0"
    }
  
    stages {
      stage("Cleanup") {
        steps {
          sh yarn cache clean
          dir('node_modules') {
            deleteDir()
          }
        }
      }
      stage("Install dependencies") {
        failFast true
        steps {
          sh yarn install --no-progress --flat --network-timeout=1000000
        }
      }
  
    }
  
  }
  </code></pre>