Node.js buildpack improved support for Yarn 2.x & 3.x dependency pruning

Change effective on 10 June 2022

For Node applications using the heroku/nodejs buildpack and Yarn 2.x or 3.x, the dependency pruning step is now integrated directly with the build tooling. Applications that need to skip this step and keep dev dependencies around can do so by setting the YARN2_SKIP_PRUNING environment variable to true.

Use of the YARN_PRODUCTION environment variable with Yarn 2.x or Yarn 3.x will also be flagged as an error since it is used to control dependency pruning with Yarn 1.x but is not compatible with later versions. The error message provided contains details on how to correct this failure.

For more information, see the Heroku Node.js support documention