Skip to content

Commit

Permalink
Update Node.js Engine Inventory (#1267)
Browse files Browse the repository at this point in the history
* Update Inventory for heroku/nodejs engine

- Added Node.js version 20.14.0.

* Fix failing integration test

Covers when npm reports errors with either:
- `npm ERR!` (older format)
- `npm error` (newer format)

---------

Co-authored-by: heroku-linguist[bot] <136119646+heroku-linguist[bot]@users.noreply.github.com>
Co-authored-by: Colin Casey <casey.colin@gmail.com>
  • Loading branch information
heroku-linguist[bot] and colincasey authored May 29, 2024
1 parent 76e47ae commit 03f8f0c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## [Unreleased]

- Added Node.js version 20.14.0.

## [v251] - 2024-05-22

Expand Down
7 changes: 7 additions & 0 deletions inventory/node.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5684,6 +5684,13 @@ arch = "linux-x64"
url = "https://heroku-nodebin.s3.us-east-1.amazonaws.com/node/release/linux-x64/node-v20.13.1-linux-x64.tar.gz"
etag = "237876341e00163bc5338ae51c3c0c11-6"

[[releases]]
version = "20.14.0"
channel = "release"
arch = "linux-x64"
url = "https://heroku-nodebin.s3.us-east-1.amazonaws.com/node/release/linux-x64/node-v20.14.0-linux-x64.tar.gz"
etag = "b468a0f3a560dbbb0c7128a512a9ac5d-6"

[[releases]]
version = "20.2.0"
channel = "release"
Expand Down
8 changes: 4 additions & 4 deletions lib/failure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -588,19 +588,19 @@ log_other_failures() {
return 0
fi

if grep -qi "npm ERR! code EBADPLATFORM" "$log_file"; then
if grep -qiE 'npm (ERR!|error) code EBADPLATFORM' "$log_file"; then
mcount "failures.npm-ebadplatform"
meta_set "failure" "npm-ebadplatform"
return 0
fi

if grep -qi "npm ERR! code EINVALIDPACKAGENAME" "$log_file"; then
if grep -qiE 'npm (ERR!|error) code EINVALIDPACKAGENAME' "$log_file"; then
mcount "failures.npm-package-name-typo"
meta_set "failure" "npm-package-name-typo"
return 0
fi

if grep -qi -e "npm ERR! code E404" -e "error An unexpected error occurred: .* Request failed \"404 Not Found\"" "$log_file"; then
if grep -qiE -e 'npm (ERR!|error) code E404' -e "error An unexpected error occurred: .* Request failed \"404 Not Found\"" "$log_file"; then
mcount "failures.module-404"
meta_set "failure" "module-404"

Expand All @@ -609,7 +609,7 @@ log_other_failures() {
meta_set "failure" "flatmap-stream-404"
warn "The flatmap-stream module has been removed from the npm registry
On November 26th, npm was notified of a malicious package that had made its
On November 26th (2018), npm was notified of a malicious package that had made its
way into event-stream, a popular npm package. After triaging the malware,
npm responded by removing flatmap-stream and event-stream@3.3.6 from the Registry
and taking ownership of the event-stream package to prevent further abuse.
Expand Down

0 comments on commit 03f8f0c

Please sign in to comment.