Compile to exe
Every time I run my exe I get the following error,
But when I start my code normally with node main.js it works without problems.
This is my Code:
This is my package.json:
5 Replies
I wasn't able to find the answer to your question in the official Deno documentation. However, based on the information you've provided in your message, there are a few things I can point out that might help you resolve the issue.
Firstly, it seems like you are trying to compile a TypeScript project that uses Node.js-specific modules (like
discord.js
) with Deno. Deno and Node.js have different runtime environments and standard libraries, so a project written for Node.js will not work out of the box with Deno. Deno does not use node_modules
or package.json
, and it has its own set of APIs and module resolution strategy.
The deno compile
command is used to compile Deno projects into standalone executables, and it expects Deno-compatible code. Since your code and dependencies are written for Node.js, you cannot directly compile them with Deno.
If you want to create an executable from your Node.js project, you would need to use a tool that is designed for Node.js, such as pkg
or nexe
.
Please note that this advice is not based on the Deno documentation, and I would advise you to double-check the accuracy of the advice given. If you are looking to work with Deno, you would need to rewrite your code to be compatible with Deno's APIs and module system.are you using deno?
i use node.js
check if it works fine with deno run
no