tsc rejects Buffer<ArrayBuffer> or reports errors inside @types/node/buffer.d.ts
Fix it fast
Most common cause, 1 of 3@types/node is older than the generic Buffer
Install the newest @types/node for the Node.js major you run in production.
# Node.js 24 in production
npm install --save-dev @types/node@24Short answer
Since TypeScript 5.7, typed arrays like Uint8Array take a type parameter, and newer @types/node releases made Buffer generic to match. Code or a library typed against the new Buffer<...> fails with TS2315 when an older @types/node is installed, and an old @types/node also breaks against a new compiler. Update @types/node to the latest release for your Node.js major version.
Which cause do you have?
Print the compiler version and every copy of @types/node in the dependency tree. Most cases are an old copy, sometimes pulled in by another package.
npx tsc --version
npm ls @types/nodeThen find the line you see in this list and open its fix:
- 1@types/node is older than the generic Buffer
TS2315 at a line that writes Buffer<...>, in your code or in a library's .d.ts - 2An old @types/node meets TypeScript 5.7 or newer
Errors point inside node_modules/@types/node, for example TS2430 in buffer.d.ts or TS2344 in fs/promises.d.ts - 3A second, older @types/node is installed by another package
npm ls @types/node lists more than one version
What does the error look like?
error TS2315: Type 'Buffer' is not generic.node_modules/@types/node/buffer.d.ts: error TS2430: Interface 'Buffer' incorrectly extends interface 'Uint8Array<ArrayBufferLike>'.error TS2344: Type 'Buffer' does not satisfy the constraint 'ArrayBufferView'.error TS2322: Type 'Buffer<ArrayBufferLike>' is not assignable to type 'Uint8Array<ArrayBuffer>'.
Cause 1 of 3
@types/node is older than the generic Buffer
You seeTS2315 at a line that writes Buffer<...>, in your code or in a library's .d.ts
Check
Buffer takes a type parameter from @types/node 22.8.0 and 20.17.0 onward; 22.7.0 and 20.16.5 still reject Buffer<ArrayBuffer> under TypeScript 5.9. A library built against a recent @types/node ships declarations that use the generic form, so it can trigger this in a project that never wrote Buffer<...> itself.
node -p "require('@types/node/package.json').version"Fix
Install the newest @types/node for the Node.js major you run in production. It updates the declarations and does not change runtime behaviour.
# Node.js 24 in production
npm install --save-dev @types/node@24Verify
The type check runs clean.
npx tsc --noEmitConfirmed by typescriptlang.org
Cause 2 of 3
An old @types/node meets TypeScript 5.7 or newer
You seeErrors point inside node_modules/@types/node, for example TS2430 in buffer.d.ts or TS2344 in fs/promises.d.ts
Check
The TypeScript 5.7 notes say typed arrays became generic and that problems with Buffer usually mean @types/node needs an update. Old declarations describe Buffer in a way the new lib files no longer accept.
npx tsc --noEmit 2>&1 | grep -c 'node_modules/@types/node'Fix
Update @types/node as in the cause above. Turning on skipLibCheck hides the declaration errors but leaves Buffer mismatched in your own code, so treat it as a stopgap only.
npm install --save-dev @types/node@latest
npx tsc --noEmitVerify
No errors reference files inside node_modules/@types/node.
npx tsc --noEmit 2>&1 | grep '@types/node' || echo cleanConfirmed by typescriptlang.org
Cause 3 of 3
A second, older @types/node is installed by another package
You seenpm ls @types/node lists more than one version
Check
Your package.json may already ask for a new version, while a dependency brings its own older copy that the compiler picks up in some folders.
npm ls @types/node --allFix
Force one version across the tree with npm overrides, then reinstall.
// package.json
"overrides": {
"@types/node": "$@types/node"
}
rm -rf node_modules package-lock.json && npm installVerify
npm ls shows a single version, deduped everywhere, and tsc passes.
npm ls @types/nodeConfirmed by docs.npmjs.com
How do I stop it coming back?
- Update @types/node and TypeScript in the same pull request.
- Pick the @types/node line that equals the Node.js release running on your servers, for example 24.x types for Node.js 24.
- Run npm ls @types/node in CI to catch a second copy early.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- QistLockA NestJS and React SaaS driving an Android Device Owner agent that locks financed phones when payments lapse.
- WorkforceA field app, an admin console and a self-hosted Node.js server for push and reconciliation.