Add node_modules/.bin to build/runtime environment PATH#1294
Merged
colincasey merged 3 commits intomainfrom Feb 18, 2026
Merged
Add node_modules/.bin to build/runtime environment PATH#1294colincasey merged 3 commits intomainfrom
node_modules/.bin to build/runtime environment PATH#1294colincasey merged 3 commits intomainfrom
Conversation
This change is to align with the classic Node.js buildpack which adds `node_modules/.bin` to `PATH` for later buildpack and runtime usage. There are several cases where this doesn't help making installed Node.js module bins available for certain package manager configurations (e.g.; Yarn Pnp, workspace installs, etc.) but, for now, this will work well for a majority of cases. > [!NOTE] > The reason why the layer is named `z_node_module_bins` is due to layers being processed in alphabetical order at runtime (see [this RFC](https://github.com/schneems/rfcs/blob/schneems/explicit-layer-ordering/text/0133-explicit-layer-order.md) for more details). The `z_` prefix ensures that the layer get processed last and the Node.js module bin path is the last one to be prepended to the `PATH`. This effect can be observed in the snapshots. [W-21259546](https://gus.lightning.force.com/a07EE00002Uj7XFYAZ)
edmorley
approved these changes
Feb 13, 2026
Merged
heroku-linguist bot
added a commit
to heroku/cnb-builder-images
that referenced
this pull request
Feb 19, 2026
## heroku/nodejs ### Added - Prepend `node_modules/.bin` to build and runtime environment `PATH`. ([#1294](heroku/buildpacks-nodejs#1294))
heroku-linguist bot
added a commit
to heroku/cnb-builder-images
that referenced
this pull request
Feb 19, 2026
## heroku/nodejs ### Added - Prepend `node_modules/.bin` to build and runtime environment `PATH`. ([#1294](heroku/buildpacks-nodejs#1294)) Co-authored-by: heroku-linguist[bot] <136119646+heroku-linguist[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change is to align with the classic Node.js buildpack which adds
node_modules/.bintoPATHfor later buildpack and runtime usage.There are several cases where this doesn't help making installed Node.js module bins available for certain package manager configurations (e.g.; Yarn Pnp, workspace installs, etc.) but, for now, this will work well for a majority of cases.
Note
The reason why the layer is named
z_node_module_binsis due to layers being processed in alphabetical order at runtime (see this RFC for more details). Thez_prefix ensures that the layer get processed last and the Node.js module bin path is the last one to be prepended to thePATH. This effect can be observed in the snapshots.W-21259546