npm install gpu.js now succeeds on every current Node release — headless-gl becomes an optional dependency, so its native build failing no longer takes the whole install down with it. No breaking changes.
headless-gl is now optional
The gl package builds a native addon, and on Node releases it does not yet support (Node 23 and later, including current Node 26) that build fails — which, as a regular dependency, failed the entire npm install gpu.js. It is now an optionalDependency: npm skips it where it cannot build and the install completes.
At runtime, nothing changes where gl is present — the headless-gl backend loads and is picked exactly as before (verified on Node 22: prebuilt binary installs, kernels run in gpu mode). Where it is absent, gpu.js skips the headless-gl backend and the automatic fallback chain lands on the next available backend — on plain Node 26 that is webasm, which since 2.22.0 runs SIMD-vectorized and threaded rather than plain JavaScript. Browser bundles are unaffected; they never contained headless-gl.
To keep using the headless-gl backend, stay on a Node release headless-gl supports (≤22) and, on Linux, install the headers its build needs: sudo apt install mesa-common-dev libxi-dev.
Installing
npm install gpu.js@2.24.0<script src="https://unpkg.com/gpu.js@2.24.0/dist/gpu-browser.min.js"></script>