Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allows to skip node installation #1405

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Main (unreleased)

- Apps with the environment variable `HEROKU_SKIP_NODE_INSTALL=1` set will no longer install auto-install nodejs and yarn.

## v262 (2023/11/08)

- Warn when relying on default Node.js or Yarn versions (https://github.com/heroku/heroku-buildpack-ruby/pull/1401)
Expand Down
4 changes: 2 additions & 2 deletions lib/language_pack/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,7 @@ def pg_adapters
# @note execjs will blow up if no JS RUNTIME is detected and is loaded.
# @return [Array] the node.js binary path if we need it or an empty Array
def add_node_js_binary
return [] if node_js_preinstalled?
return [] if node_js_preinstalled? || env("HEROKU_SKIP_NODE_INSTALL")

if Pathname(build_path).join("package.json").exist? ||
bundler.has_gem?('execjs') ||
Expand Down Expand Up @@ -1045,7 +1045,7 @@ def add_node_js_binary
end

def add_yarn_binary
return [] if yarn_preinstalled?
return [] if yarn_preinstalled? || env("HEROKU_SKIP_NODE_INSTALL")

if Pathname(build_path).join("yarn.lock").exist? || bundler.has_gem?('webpacker')

Expand Down