title: Yarn script produces different output than running command directly
body: <p>I have a script defined in <code>package.json</code>:</p>
  
  <pre><code>"scripts": {
    "prettierCheck": "./node_modules/.bin/prettier --check ./app/javascript/**/*.js"
  }
  </code></pre>
  
  <p>If I run this script using <code>yarn run prettierCheck</code>, Prettier does not find any formatting issues with my files. However, if I run the Prettier command directly, it finds violating files.</p>
  
  <p>Output of <code>yarn run prettierCheck</code>:</p>
  
  <pre><code>~/Projects/tome $ yarn run prettierCheck
  yarn run v1.19.0
  $ ./node_modules/.bin/prettier --check ./app/javascript/**/*.js
  Checking formatting...
  All matched files use Prettier code style!
  Done in 0.20s
  </code></pre>
  
  <p>Output of <code>./node_modules/.bin/prettier --check ./app/javascript/**/*.js</code>:</p>
  
  <pre><code>~/Projects/tome $ ./node_modules/.bin/prettier --check ./app/javascript/**/*.js
  Checking formatting...
  {... several files listed here ...}
  Code style issues found in the above file(s). Forgot to run Prettier?
  </code></pre>
  
  <p>Why does this happen? What is the difference between running the command directly vs. through a Yarn script?</p>