Skip to content

Add node_modules/.bin to build/runtime environment PATH#1294

Merged
colincasey merged 3 commits intomainfrom
add_node_modules_bin_path
Feb 18, 2026
Merged

Add node_modules/.bin to build/runtime environment PATH#1294
colincasey merged 3 commits intomainfrom
add_node_modules_bin_path

Conversation

@colincasey
Copy link
Copy Markdown
Contributor

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 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

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)
@colincasey colincasey self-assigned this Feb 13, 2026
@colincasey colincasey requested a review from a team as a code owner February 13, 2026 15:15
@colincasey colincasey merged commit eb842bd into main Feb 18, 2026
7 checks passed
@colincasey colincasey deleted the add_node_modules_bin_path branch February 18, 2026 19:51
heroku-linguist bot added a commit that referenced this pull request Feb 18, 2026
## heroku/nodejs

### Added

- Prepend `node_modules/.bin` to build and runtime environment `PATH`. ([#1294](#1294))
heroku-linguist bot added a commit that referenced this pull request Feb 19, 2026
## heroku/nodejs

### Added

- Prepend `node_modules/.bin` to build and runtime environment `PATH`. ([#1294](#1294))

Co-authored-by: heroku-linguist[bot] <136119646+heroku-linguist[bot]@users.noreply.github.com>
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants