Skip to content

Commit

Permalink
Warning for installations for Node.js v22.5.0 (#1299)
Browse files Browse the repository at this point in the history
* Warning for installations for Node.js v22.5.0
  • Loading branch information
colincasey authored Jul 19, 2024
1 parent e80b471 commit db755e1
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## [Unreleased]

- Added warning about Node v22.5.0 issues. ([#1299](https://github.com/heroku/heroku-buildpack-nodejs/pull/1299))


## [v259] - 2024-07-18

Expand Down
4 changes: 4 additions & 0 deletions lib/binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ install_nodejs() {
fi

echo "Downloading and installing node $number..."

if [[ "$number" == "22.5.0" ]]; then
warn_about_node_version_22_5_0
fi
fi

code=$(curl "$url" -L --silent --fail --retry 5 --retry-max-time 15 --retry-connrefused --connect-timeout 5 -o /tmp/node.tar.gz --write-out "%{http_code}")
Expand Down
12 changes: 12 additions & 0 deletions lib/failure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -995,3 +995,15 @@ warn_skipping_unsafe_pnpm_prune() {
must upgrade your version of pnpm to 8.15.6 or higher."
mcount 'warnings.pnpm.unsafe-prune'
}

warn_about_node_version_22_5_0() {
echo ""
warn "Issues with Node.js v22.5.0
Shortly after the release of Node.js v22.5.0, users began reporting issues around broken
or hanging installs for npm and Yarn. To avoid experiencing these problems with your builds
on Heroku, we recommend avoiding this release version until a fix has been released by
pinning to an earlier version of Node.js (e.g.; 22.4.1).
" "https://github.com/nodejs/node/pull/53934"
mcount 'warnings.node.22-5-0'
}
1 change: 1 addition & 0 deletions test/fixtures/node-22.5.0-warning/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A fake README, to keep npm from polluting stderr.
15 changes: 15 additions & 0 deletions test/fixtures/node-22.5.0-warning/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "node-buildpack-test-app",
"version": "0.0.1",
"description": "node buildpack integration test app",
"repository" : {
"type" : "git",
"url" : "http://github.com/example/example.git"
},
"engines": {
"node": "22.5.0"
},
"scripts": {
"start": "node foo.js"
}
}
7 changes: 7 additions & 0 deletions test/run
Original file line number Diff line number Diff line change
Expand Up @@ -2011,6 +2011,13 @@ testPnpmWorkspaceBinaries() {
assertCapturedSuccess
}

testWarningNode_22_5_0() {
compile "node-22.5.0-warning"
assertCaptured "Issues with Node.js v22.5.0"
cat "$STD_OUT"
assertCapturedSuccess
}

# Utils

pushd "$(dirname 0)" >/dev/null
Expand Down

0 comments on commit db755e1

Please sign in to comment.