vercel / pkg

Package your Node.js project into an executable
https://npmjs.com/pkg
MIT License
24.33k stars 1.02k forks source link

Strange exe crash because of "usb" library #1943

Closed uenz98 closed 1 year ago

uenz98 commented 1 year ago

What version of pkg are you using?

5.8.1

What version of Node.js are you using?

16.16.0

What operating system are you using?

Windows 10

What CPU architecture are you using?

x86_64

What Node versions, OSs and CPU architectures are you building for?

node12-win32-x64

Describe the Bug

This is my dependency list: this

I've tried including some prebuilds in my temporary directory where I am doing tests here Here you can see the directory and file structure

The node.abi72.node is the prebuild for zeromq and during the build process it's clearly written in console to include the prebuild in the distributed path. I got errors, but as soon as I included the prebuilt file, the error changed. The package noble includes bluetooth-hci-socket that includes usb, their prebuilds are binding.node and node.napi.node respectively. At first, without including those files, the error was: image

but when I put those files in the prebuilds folder, this is what is printed in the console after the executable is launched: this

How can I make it work?

Expected Behavior

build the JS file in a win32-x64 exe and launch it without errors

To Reproduce

  1. create a npm project
  2. install noble (npm i noble)
  3. require noble in the JS file
  4. build the executable (pkg -t node12-win32-x64 index.js)
  5. launch the executable
github-actions[bot] commented 1 year ago

This issue is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 5 days. To ignore this issue entirely you can add the no-stale label

github-actions[bot] commented 1 year ago

This issue is now closed due to inactivity, you can of course reopen or reference this issue if you see fit.