Drop Node.js 18, now requires Node.js >= 20.9.0

This commit is contained in:
Lovell Fuller
2025-12-17 14:44:46 +00:00
parent 34c39fa194
commit 283c7d3f0c
21 changed files with 98 additions and 88 deletions

View File

@@ -31,7 +31,7 @@ please open an issue against that package instead.
<!-- Please place an [x] in the relevant box to confirm. --> <!-- Please place an [x] in the relevant box to confirm. -->
- [ ] I am using Node.js with a version that satisfies `^18.17.0 || ^20.3.0 || >=21.0.0` - [ ] I am using Node.js with a version that satisfies `>=20.9.0`
- [ ] I am using Deno - [ ] I am using Deno
- [ ] I am using Bun - [ ] I am using Bun

View File

@@ -9,8 +9,8 @@ jobs:
contents: read contents: read
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v6
- uses: actions/setup-node@v5 - uses: actions/setup-node@v6
with: with:
node-version: "24" node-version: "24"
- run: npm install --ignore-scripts - run: npm install --ignore-scripts
@@ -31,123 +31,129 @@ jobs:
- os: ubuntu-24.04 - os: ubuntu-24.04
container: rockylinux:8 container: rockylinux:8
nodejs_arch: x64 nodejs_arch: x64
nodejs_version: "^18.17.0" nodejs_version: "^20.9.0"
nodejs_version_major: 18 nodejs_version_major: 20
platform: linux-x64 platform: linux-x64
package: true package: true
- os: ubuntu-24.04 - os: ubuntu-24.04
container: rockylinux:8 container: rockylinux:8
nodejs_arch: x64 nodejs_arch: x64
nodejs_version: "^20.3.0" nodejs_version: "^22"
nodejs_version_major: 20
platform: linux-x64
- os: ubuntu-24.04
container: rockylinux:8
nodejs_arch: x64
nodejs_version: "^22.9.0"
nodejs_version_major: 22 nodejs_version_major: 22
platform: linux-x64 platform: linux-x64
- os: ubuntu-24.04 - os: ubuntu-24.04
container: node:18-alpine3.17 container: rockylinux:8
nodejs_version_major: 18 nodejs_arch: x64
platform: linuxmusl-x64 nodejs_version: "^24"
package: true nodejs_version_major: 24
platform: linux-x64
- os: ubuntu-24.04 - os: ubuntu-24.04
container: node:20-alpine3.18 container: node:20-alpine3.18
nodejs_version_major: 20 nodejs_version_major: 20
platform: linuxmusl-x64 platform: linuxmusl-x64
package: true
- os: ubuntu-24.04 - os: ubuntu-24.04
container: node:22-alpine3.20 container: node:22-alpine3.20
nodejs_version_major: 22 nodejs_version_major: 22
platform: linuxmusl-x64 platform: linuxmusl-x64
- os: ubuntu-24.04
container: node:24-alpine3.22
nodejs_version_major: 24
platform: linuxmusl-x64
- os: ubuntu-24.04-arm - os: ubuntu-24.04-arm
container: arm64v8/rockylinux:8 container: arm64v8/rockylinux:8
nodejs_arch: arm64 nodejs_arch: arm64
nodejs_version: "^18.17.0" nodejs_version: "^20.9.0"
nodejs_version_major: 18 nodejs_version_major: 20
platform: linux-arm64 platform: linux-arm64
package: true package: true
- os: ubuntu-24.04-arm - os: ubuntu-24.04-arm
container: arm64v8/rockylinux:8 container: arm64v8/rockylinux:8
nodejs_arch: arm64 nodejs_arch: arm64
nodejs_version: "^20.3.0" nodejs_version: "^22"
nodejs_version_major: 20 nodejs_version_major: 22
platform: linux-arm64
- os: ubuntu-24.04-arm
container: arm64v8/rockylinux:8
nodejs_arch: arm64
nodejs_version: "^24"
nodejs_version_major: 24
platform: linux-arm64 platform: linux-arm64
- os: macos-15-intel - os: macos-15-intel
nodejs_arch: x64 nodejs_arch: x64
nodejs_version: "^18.17.0" nodejs_version: "^20.9.0"
nodejs_version_major: 18 nodejs_version_major: 20
platform: darwin-x64 platform: darwin-x64
package: true package: true
- os: macos-15-intel - os: macos-15-intel
nodejs_arch: x64 nodejs_arch: x64
nodejs_version: "^20.3.0" nodejs_version: "^22"
nodejs_version_major: 20 nodejs_version_major: 22
platform: darwin-x64 platform: darwin-x64
- os: macos-15-intel - os: macos-15-intel
nodejs_arch: x64 nodejs_arch: x64
nodejs_version: "^22.9.0" nodejs_version: "^24"
nodejs_version_major: 22 nodejs_version_major: 24
platform: darwin-x64 platform: darwin-x64
- os: macos-15 - os: macos-15
nodejs_arch: arm64 nodejs_arch: arm64
nodejs_version: "^18.17.0" nodejs_version: "^20.9.0"
nodejs_version_major: 18 nodejs_version_major: 20
platform: darwin-arm64 platform: darwin-arm64
package: true package: true
- os: macos-15 - os: macos-15
nodejs_arch: arm64 nodejs_arch: arm64
nodejs_version: "^20.3.0" nodejs_version: "^22"
nodejs_version_major: 20 nodejs_version_major: 22
platform: darwin-arm64 platform: darwin-arm64
- os: macos-15 - os: macos-15
nodejs_arch: arm64 nodejs_arch: arm64
nodejs_version: "^22.9.0" nodejs_version: "^24"
nodejs_version_major: 22 nodejs_version_major: 24
platform: darwin-arm64 platform: darwin-arm64
- os: windows-2022 - os: windows-2022
nodejs_arch: x86 nodejs_arch: x86
nodejs_version: "18.18.2" # pinned to avoid 18.19.0 and npm 10 nodejs_version: "^20.9.0"
nodejs_version_major: 18 nodejs_version_major: 20
platform: win32-ia32 platform: win32-ia32
package: true package: true
- os: windows-2022 - os: windows-2022
nodejs_arch: x86 nodejs_arch: x86
nodejs_version: "^20.3.0" nodejs_version: "^22"
nodejs_version_major: 20
platform: win32-ia32
- os: windows-2022
nodejs_arch: x86
nodejs_version: "^22.9.0"
nodejs_version_major: 22 nodejs_version_major: 22
platform: win32-ia32 platform: win32-ia32
- os: windows-2022 - os: windows-2022
nodejs_arch: x64 nodejs_arch: x64
nodejs_version: "^18.17.0" nodejs_version: "^20.9.0"
nodejs_version_major: 18 nodejs_version_major: 20
platform: win32-x64 platform: win32-x64
package: true package: true
- os: windows-2022 - os: windows-2022
nodejs_arch: x64 nodejs_arch: x64
nodejs_version: "^20.3.0" nodejs_version: "^22"
nodejs_version_major: 20 nodejs_version_major: 22
platform: win32-x64 platform: win32-x64
- os: windows-2022 - os: windows-2022
nodejs_arch: x64 nodejs_arch: x64
nodejs_version: "^22.9.0" nodejs_version: "^24"
nodejs_version_major: 22 nodejs_version_major: 24
platform: win32-x64 platform: win32-x64
- os: windows-11-arm - os: windows-11-arm
nodejs_arch: arm64 nodejs_arch: arm64
nodejs_version: "^20.3.0" nodejs_version: "^20.9.0"
nodejs_version_major: 20 nodejs_version_major: 20
platform: win32-arm64 platform: win32-arm64
package: true package: true
- os: windows-11-arm - os: windows-11-arm
nodejs_arch: arm64 nodejs_arch: arm64
nodejs_version: "^22.9.0" nodejs_version: "^22"
nodejs_version_major: 22 nodejs_version_major: 22
platform: win32-arm64 platform: win32-arm64
- os: windows-11-arm
nodejs_arch: arm64
nodejs_version: "^24"
nodejs_version_major: 24
platform: win32-arm64
steps: steps:
- name: Dependencies (Rocky Linux glibc) - name: Dependencies (Rocky Linux glibc)
if: contains(matrix.container, 'rockylinux') if: contains(matrix.container, 'rockylinux')
@@ -159,22 +165,22 @@ jobs:
run: apk add build-base git python3 font-noto --update-cache run: apk add build-base git python3 font-noto --update-cache
- name: Dependencies (Python 3.11 - macOS, Windows) - name: Dependencies (Python 3.11 - macOS, Windows)
if: contains(matrix.os, 'macos') || contains(matrix.os, 'windows') if: contains(matrix.os, 'macos') || contains(matrix.os, 'windows')
uses: actions/setup-python@v5 uses: actions/setup-python@v6
with: with:
python-version: "3.12" python-version: "3.12"
- name: Dependencies (Node.js) - name: Dependencies (Node.js)
if: "!contains(matrix.platform, 'linuxmusl')" if: "!contains(matrix.platform, 'linuxmusl')"
uses: actions/setup-node@v5 uses: actions/setup-node@v6
with: with:
node-version: ${{ matrix.nodejs_version }} node-version: ${{ matrix.nodejs_version }}
architecture: ${{ matrix.nodejs_arch }} architecture: ${{ matrix.nodejs_arch }}
- uses: actions/checkout@v4 - uses: actions/checkout@v6
- run: npm install - run: npm install
- run: npm run build - run: npm run build
- run: npm run test-unit - run: npm run test-unit
- if: matrix.package - if: matrix.package
run: npm run package-from-local-build run: npm run package-from-local-build
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v6
if: matrix.package if: matrix.package
with: with:
name: ${{ matrix.platform }} name: ${{ matrix.platform }}
@@ -191,16 +197,18 @@ jobs:
image: ${{ matrix.container }} image: ${{ matrix.container }}
volumes: volumes:
- /opt:/opt:rw,rshared - /opt:/opt:rw,rshared
- /opt:/__e/node20:ro,rshared - /opt:/__e/node24:ro,rshared
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
include: include:
- container: node:18-alpine3.17 - container: node:20-alpine3.20
nodejs_version_major: 18
package: true
- container: node:20-alpine3.18
nodejs_version_major: 20 nodejs_version_major: 20
package: true
- container: node:22-alpine3.20
nodejs_version_major: 22
- container: node:24-alpine3.22
nodejs_version_major: 24
steps: steps:
- name: Allow Linux musl containers on ARM64 runners # https://github.com/actions/runner/issues/801#issuecomment-2394425757 - name: Allow Linux musl containers on ARM64 runners # https://github.com/actions/runner/issues/801#issuecomment-2394425757
shell: sh shell: sh
@@ -211,13 +219,13 @@ jobs:
ln -s /usr/bin/node /opt/bin/node ln -s /usr/bin/node /opt/bin/node
- name: Dependencies - name: Dependencies
run: apk add build-base git python3 font-noto --update-cache run: apk add build-base git python3 font-noto --update-cache
- uses: actions/checkout@v4 - uses: actions/checkout@v6
- run: npm install - run: npm install
- run: npm run build - run: npm run build
- run: npm run test-unit - run: npm run test-unit
- if: matrix.package - if: matrix.package
run: npm run package-from-local-build run: npm run package-from-local-build
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v6
if: matrix.package if: matrix.package
with: with:
name: linuxmusl-arm64 name: linuxmusl-arm64
@@ -238,20 +246,20 @@ jobs:
base_image: "balenalib/rpi-raspbian:bullseye" base_image: "balenalib/rpi-raspbian:bullseye"
nodejs_arch: armv6l nodejs_arch: armv6l
nodejs_hostname: unofficial-builds.nodejs.org nodejs_hostname: unofficial-builds.nodejs.org
nodejs_version: "18.17.0" nodejs_version: "20.9.0"
nodejs_version_major: 18 nodejs_version_major: 20
- platform: linux-s390x - platform: linux-s390x
base_image: "--platform=linux/s390x s390x/debian:bookworm" base_image: "--platform=linux/s390x s390x/debian:bookworm"
nodejs_arch: s390x nodejs_arch: s390x
nodejs_hostname: nodejs.org nodejs_hostname: nodejs.org
nodejs_version: "18.17.0" nodejs_version: "20.9.0"
nodejs_version_major: 18 nodejs_version_major: 20
- platform: linux-ppc64 - platform: linux-ppc64
base_image: "--platform=linux/ppc64le ppc64le/debian:bookworm" base_image: "--platform=linux/ppc64le ppc64le/debian:bookworm"
nodejs_arch: ppc64le nodejs_arch: ppc64le
nodejs_hostname: nodejs.org nodejs_hostname: nodejs.org
nodejs_version: "18.17.0" nodejs_version: "20.9.0"
nodejs_version_major: 18 nodejs_version_major: 20
- platform: linux-riscv64 - platform: linux-riscv64
base_image: "--platform=linux/riscv64 riscv64/debian:trixie" base_image: "--platform=linux/riscv64 riscv64/debian:trixie"
compiler_flags: "-march=rv64gc" compiler_flags: "-march=rv64gc"
@@ -260,7 +268,7 @@ jobs:
nodejs_version: "20.19.5" nodejs_version: "20.19.5"
nodejs_version_major: 20 nodejs_version_major: 20
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v6
- uses: uraimo/run-on-arch-action@v3 - uses: uraimo/run-on-arch-action@v3
with: with:
arch: none arch: none
@@ -279,7 +287,7 @@ jobs:
npm run build npm run build
node --test test/unit/io.js node --test test/unit/io.js
npm run package-from-local-build npm run package-from-local-build
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v6
with: with:
name: ${{ matrix.platform }} name: ${{ matrix.platform }}
path: npm/${{ matrix.platform }} path: npm/${{ matrix.platform }}
@@ -311,7 +319,7 @@ jobs:
test "$EMSCRIPTEN_VERSION_LIBVIPS" = "$EMSCRIPTEN_VERSION_SHARP" test "$EMSCRIPTEN_VERSION_LIBVIPS" = "$EMSCRIPTEN_VERSION_SHARP"
- run: emmake npm run test-unit - run: emmake npm run test-unit
- run: emmake npm run package-from-local-build - run: emmake npm run package-from-local-build
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v6
with: with:
name: wasm32 name: wasm32
path: npm/wasm32 path: npm/wasm32
@@ -329,12 +337,12 @@ jobs:
- build-emscripten - build-emscripten
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/download-artifact@v4 - uses: actions/download-artifact@v7
with: with:
path: npm path: npm
- name: Create npm workspace tarball - name: Create npm workspace tarball
run: tar -vcaf npm-workspace.tar.xz --directory npm --exclude=from-local-build.js . run: tar -vcaf npm-workspace.tar.xz --directory npm --exclude=from-local-build.js .
- uses: actions/setup-node@v5 - uses: actions/setup-node@v6
with: with:
node-version: '24' node-version: '24'
- name: Create release notes - name: Create release notes

View File

@@ -8,7 +8,7 @@ smaller, web-friendly JPEG, PNG, WebP, GIF and AVIF images of varying dimensions
It can be used with all JavaScript runtimes It can be used with all JavaScript runtimes
that provide support for Node-API v9, including that provide support for Node-API v9, including
Node.js (^18.17.0 or >= 20.3.0), Deno and Bun. Node.js (>= 20.9.0), Deno and Bun.
Resizing an image is typically 4x-5x faster than using the Resizing an image is typically 4x-5x faster than using the
quickest ImageMagick and GraphicsMagick settings quickest ImageMagick and GraphicsMagick settings

View File

@@ -4,3 +4,5 @@ slug: changelog/v0.35.0
--- ---
* Upgrade to libvips v8.18.0 for upstream bug fixes. * Upgrade to libvips v8.18.0 for upstream bug fixes.
* Drop support for Node.js 18, now requires Node.js >= 20.9.0.

View File

@@ -10,7 +10,7 @@ smaller, web-friendly JPEG, PNG, WebP, GIF and AVIF images of varying dimensions
It can be used with all JavaScript runtimes It can be used with all JavaScript runtimes
that provide support for Node-API v9, including that provide support for Node-API v9, including
Node.js >= 18.17.0, Deno and Bun. Node.js >= 20.9.0, Deno and Bun.
Resizing an image is typically 4x-5x faster than using the Resizing an image is typically 4x-5x faster than using the
quickest ImageMagick and GraphicsMagick settings quickest ImageMagick and GraphicsMagick settings

View File

@@ -39,7 +39,7 @@ deno run --allow-env --allow-ffi --allow-read --allow-sys ...
## Prerequisites ## Prerequisites
* Node-API v9 compatible runtime e.g. Node.js ^18.17.0 or >=20.3.0. * Node-API v9 compatible runtime e.g. Node.js >= 20.9.0.
## Prebuilt binaries ## Prebuilt binaries

View File

@@ -29,7 +29,7 @@
"./package": "./package.json" "./package": "./package.json"
}, },
"engines": { "engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0" "node": ">=20.9.0"
}, },
"os": [ "os": [
"darwin" "darwin"

View File

@@ -29,7 +29,7 @@
"./package": "./package.json" "./package": "./package.json"
}, },
"engines": { "engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0" "node": ">=20.9.0"
}, },
"os": [ "os": [
"darwin" "darwin"

View File

@@ -29,7 +29,7 @@
"./package": "./package.json" "./package": "./package.json"
}, },
"engines": { "engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0" "node": ">=20.9.0"
}, },
"config": { "config": {
"glibc": ">=2.31" "glibc": ">=2.31"

View File

@@ -29,7 +29,7 @@
"./package": "./package.json" "./package": "./package.json"
}, },
"engines": { "engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0" "node": ">=20.9.0"
}, },
"config": { "config": {
"glibc": ">=2.26" "glibc": ">=2.26"

View File

@@ -29,7 +29,7 @@
"./package": "./package.json" "./package": "./package.json"
}, },
"engines": { "engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0" "node": ">=20.9.0"
}, },
"config": { "config": {
"glibc": ">=2.36" "glibc": ">=2.36"

View File

@@ -29,7 +29,7 @@
"./package": "./package.json" "./package": "./package.json"
}, },
"engines": { "engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0" "node": ">=20.9.0"
}, },
"config": { "config": {
"glibc": ">=2.41" "glibc": ">=2.41"

View File

@@ -29,7 +29,7 @@
"./package": "./package.json" "./package": "./package.json"
}, },
"engines": { "engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0" "node": ">=20.9.0"
}, },
"config": { "config": {
"glibc": ">=2.36" "glibc": ">=2.36"

View File

@@ -29,7 +29,7 @@
"./package": "./package.json" "./package": "./package.json"
}, },
"engines": { "engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0" "node": ">=20.9.0"
}, },
"config": { "config": {
"glibc": ">=2.26" "glibc": ">=2.26"

View File

@@ -29,7 +29,7 @@
"./package": "./package.json" "./package": "./package.json"
}, },
"engines": { "engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0" "node": ">=20.9.0"
}, },
"config": { "config": {
"musl": ">=1.2.2" "musl": ">=1.2.2"

View File

@@ -29,7 +29,7 @@
"./package": "./package.json" "./package": "./package.json"
}, },
"engines": { "engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0" "node": ">=20.9.0"
}, },
"config": { "config": {
"musl": ">=1.2.2" "musl": ">=1.2.2"

View File

@@ -28,7 +28,7 @@
"./versions": "./versions.json" "./versions": "./versions.json"
}, },
"engines": { "engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0" "node": ">=20.9.0"
}, },
"dependencies": { "dependencies": {
"@emnapi/runtime": "^1.7.1" "@emnapi/runtime": "^1.7.1"

View File

@@ -28,7 +28,7 @@
"./versions": "./versions.json" "./versions": "./versions.json"
}, },
"engines": { "engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0" "node": ">=20.9.0"
}, },
"os": [ "os": [
"win32" "win32"

View File

@@ -28,7 +28,7 @@
"./versions": "./versions.json" "./versions": "./versions.json"
}, },
"engines": { "engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0" "node": ">=20.9.0"
}, },
"os": [ "os": [
"win32" "win32"

View File

@@ -28,7 +28,7 @@
"./versions": "./versions.json" "./versions": "./versions.json"
}, },
"engines": { "engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0" "node": ">=20.9.0"
}, },
"os": [ "os": [
"win32" "win32"

View File

@@ -191,7 +191,7 @@
}, },
"license": "Apache-2.0", "license": "Apache-2.0",
"engines": { "engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0" "node": ">=20.9.0"
}, },
"config": { "config": {
"libvips": ">=8.18.0" "libvips": ">=8.18.0"