title: Upgrading webpacker from 4.2.2 to 5.0.1 is no longer running yarn install before assets:precompile
body: <p>After following each step in the <a href="https://github.com/rails/webpacker#upgrading" rel="nofollow noreferrer">webpacker upgrading</a> section, an upgrade from <code>4.2.2</code> to <code>5.0.1</code>, is causing <code>yarn install</code> to no longer be invoked during <code>rails assets:precompile</code>. This is causing front-end packages sourced from our <code>package.json</code> file to not be found during the asset compilation process.</p>
  
  <p>This is highlighted when CI runs <code>rails assets:precompile</code>. Previously <code>assets:precompile</code> would run <code>yarn install</code> before compiling our <code>application.js</code> file. I've added the <code>--trace</code> flag and it runs as if it skips <code>yarn install</code>.</p>
  
  <pre><code>** Invoke yarn:install (first_time)
  ** Execute yarn:install
  ** Execute assets:precompile
  rails aborted!
  Sprockets::FileNotFound: couldn't find file 'moment' with type 'application/javascript'
  </code></pre>
  
  <p>The same CI run with the older webpack version displays the <code>yarn install</code> output as expected. Has anyone run into this same issue when bumping to 5.x?</p>