DenoDDeno
Powered by
KlexikK
Denoβ€’8mo agoβ€’
6 replies
Klexik

Deno compile with @types/node (Buffer) issue

Hi,
I am trying to get Deno to compile my node.js project and I am hitting the wall with typechecking (I know about --no-check, I just want to resolve this)
Error:
TS2580 [ERROR]: Cannot find name 'Buffer'.
return { out: Buffer.from(out).toString('hex'), result };

After some googling, I found there should be workaround https://docs.deno.com/runtime/fundamentals/node/#including-node-types
But unfortunalty the documentation mention is extremly vague.
Including /// <reference types="npm:@types/node" /> in top of my files does nothing, including it on top index.d.ts / buffer.d.ts in @types/node does nothing.

Did anyone had similiar issue / have knowledge how to resolve this?
Deno
Node and npm Compatibility
Guide to using Node.js modules and npm packages in Deno. Learn about compatibility features, importing npm packages, and differences between Node.js and Deno environments.
Node and npm Compatibility
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

deno compile include all node_modules...
njzyNnjzy / help
4w ago
Deno compile with --include
carragomCcarragom / help
6mo ago
Deno Compile Can't Find Node Module
werthanWwerthan / help
13mo ago