You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What happened:
I am using the serialport library. When I build an executable that uses it, it seems like it's looking for some native binding files in node_modules outside its virtual filesystem. This means that once I move the executable somewhere else (e.g. C:\), it throws this error on startup:
C:\node_modules\bindings\bindings.js:211
throw new Error(
^
Error: Could not find module root given file: "C:\node_modules\@serialport\bindings\lib\win32.js". Do you have a `package.json` file?
at Function.getRoot (C:\node_modules\bindings\bindings.js:211:13)
at bindings (C:\node_modules\bindings\bindings.js:82:32)
at Object.<anonymous> (C:\node_modules\@serialport\bindings\lib\win32.js:1:36)
at Module._compile (internal/modules/cjs/loader.js:959:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
at Module.load (internal/modules/cjs/loader.js:815:32)
at Function.Module._load (internal/modules/cjs/loader.js:727:14)
at Module.require (internal/modules/cjs/loader.js:852:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (C:\node_modules\@serialport\bindings\lib\index.js:6:22)
What you expected to happen:
Expected the serialport module to load correctly.
How to reproduce it (as minimally and precisely as possible):
Native modules need to be shipped alongside the binary since they are required to be linked from filesystem with dlopen. The process for linking a dynamic library from memory is not universal across platforms. While it is technically possible, this capability has not been added to nexe or prioritized due to the scope involved in creating and maintaining it.
What happened:
I am using the serialport library. When I build an executable that uses it, it seems like it's looking for some native binding files in node_modules outside its virtual filesystem. This means that once I move the executable somewhere else (e.g.
C:\
), it throws this error on startup:What you expected to happen:
Expected the serialport module to load correctly.
How to reproduce it (as minimally and precisely as possible):
npm install [email protected]
nexe index.js -o app.exe
Environment:
The text was updated successfully, but these errors were encountered: