heroku / buildpacks-nodejs

Heroku's Cloud Native Buildpacks for Node.js applications.
BSD 3-Clause "New" or "Revised" License
2 stars 2 forks source link

Fix for yarn 2.4.3 #626

Closed colincasey closed 1 year ago

colincasey commented 1 year ago

After #617 was merged our inventory automation ran and the PR to update the yarn inventory with 2.4.3 (#620) had failing tests that showed that the layout for this version did not match our other distributions.

This PR handles this edge case by renaming the bin/yarn.js script to bin/yarn which matches the binary we expect to find. This is slightly different the @yarnpkg/cli-dist layout which uses a portable shell script at yarn/bin that calls node /path/to/yarn.js.

colincasey commented 1 year ago

While this fix does address the issue with using 2.4.3 as a global yarn binary, instead of having to add this special case that executes on every build, we've decided to exclude 2.4.3 from our inventory listing.

This should not impact applications that use 2.4.3 because in Yarn 2+ you are expected to commit the .yarn/release/yarn-vX.Y.Z.cjs file which controls the actual version of Yarn used during a build. The globally installed Yarn simply operates as a wrapper to invoking the commited release version and that should be compatible with all of our other versions of Yarn in our inventory.