FutureLights
FutureLights3mo ago

Deno Compile Exe doesn't run

Quick question, I just got started with deno because I wanted to make an exe of my simple node js app. It ran pretty much right away without having to change anything except adding node: in front of my path and crypto imports. Honestly, I was expecting to have to do so much more so that was awesome. It compiled just fine to an exe, but when I try to run the exe, it outputs with:
Uncaught (in promise) Error: Could not locate the bindings file. Tried:
→ C:\Users\usr\AppData\Local\Temp\deno-compile-file-importer.exe\file-importer\node_modules\.deno\drivelist@12.0.2\node_modules\drivelist\build\drivelist.node
...
at Module._compile (node:module:748:34)
at Object.Module._extensions..js (node:module:767:10)
at Module.load (node:module:665:32)
at Function.Module._load (node:module:537:12)
at Module.require (node:module:684:19)
at require (node:module:808:16)
at file:///C:/Users/usr/AppData/Local/Temp/deno-compile-file-importer.exe/file-importer/node_modules/.deno/drivelist@12.0.2/node_modules/drivelist/js/index.js:3:13
Uncaught (in promise) Error: Could not locate the bindings file. Tried:
→ C:\Users\usr\AppData\Local\Temp\deno-compile-file-importer.exe\file-importer\node_modules\.deno\drivelist@12.0.2\node_modules\drivelist\build\drivelist.node
...
at Module._compile (node:module:748:34)
at Object.Module._extensions..js (node:module:767:10)
at Module.load (node:module:665:32)
at Function.Module._load (node:module:537:12)
at Module.require (node:module:684:19)
at require (node:module:808:16)
at file:///C:/Users/usr/AppData/Local/Temp/deno-compile-file-importer.exe/file-importer/node_modules/.deno/drivelist@12.0.2/node_modules/drivelist/js/index.js:3:13
It ran just fine with deno -A index.js so I assumed building it would work with the old npm packages. I feel like I'm missing something really basic. Do I need to replace the problematic drivelist npm package to something that's more deno compatible? I didn't see anything about certain packages working/not working in the documentation for deno compile as opposed to just running normally. I've tried using a variety of flags with compile but nothing has resulted in a working exe yet. Any help is appreciated!
5 Replies
ioB
ioB3mo ago
drivelist uses napi. I don't believe this is supported quite yet in deno compile. I found this open issue: https://github.com/denoland/deno/issues/23266. cc @divy
GitHub
Issues · denoland/deno
A modern runtime for JavaScript and TypeScript. Contribute to denoland/deno development by creating an account on GitHub.
divy
divy3mo ago
yup @snek is working on a fix https://github.com/denoland/deno/pull/26389
FutureLights
FutureLightsOP3mo ago
So if I'm understanding this right, native node modules can't be used with compile? I'd assume any deno equivalents, if they exist would work?
divy
divy3mo ago
yes
FutureLights
FutureLightsOP3mo ago
Thanks for the clarification.

Did you find this page helpful?