Closed Kenhuey closed 2 years ago
Seems like i found the part of solution of that. Copy ./node_module/node-pty/build/release/pty.node to the exe root path.
But I still meet a problem on pkg :(
Error logs:
[2021-10-21 19:35:39] [ERROR] <10_0_12_11 11656> console - innerError TypeError: Cannot read property '1' of null
at process.dlopen (pkg/prelude/bootstrap.js:2071:69)
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1131:18)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module._load (internal/modules/cjs/loader.js:778:12)
at Module.require (internal/modules/cjs/loader.js:961:19)
at Module.require (pkg/prelude/bootstrap.js:1719:31)
at require (internal/modules/cjs/helpers.js:92:18)
at new WindowsPtyAgent (C:\snapshot\myproject1\node_modules\node-pty\lib\windowsPtyAgent.js:57:40)
at new WindowsTerminal (C:\snapshot\myproject1\node_modules\node-pty\lib\windowsTerminal.js:50:24)
at spawn (C:\snapshot\myproject1\node_modules\node-pty\lib\index.js:28:12)
This error seems specific to pkg
, we can't answer it unfortunately.
Environment details
Issue description
When I using pkg to package executable win64 exe file, something go wrong. I separate all the functions to test, only node-pty gose wrong in runtime. Use "node ./dist/main.js" works well, but issue is run at after build exe file. (Not in Electron,)
Related code:
Error logs: