I have a node app that works fantastically when running it with node .
But when I attempt to use pkg to make executables for Linux, Mac OS and Windows I come across 2 problems
1.
Warning Cannot resolve '
./modules/startup.js'
C:\Users\Casper\Documents\GitHub\Redacted\index.js
Dynamic require may fail at run time, because the requested file
is unknown at compilation time and not included into executable.
Use a string literal as an argument for 'require', or leave it
as is and specify the resolved file name in 'scripts' option.
I get that for 3 different files when doing pkg .
and in my package.json I have
"bin": "./index.js",
"pkg": {
"assets": [
"./modules//",
"./systems//",
"./events/*/"
]
},
2.
When launching one of the executables I get
pkg/prelude/bootstrap.js:1185
throw error;
^Error: Timed out waiting for sync-rpc server to start (it should respond with "pong" when sent "ping"):
internal/modules/cjs/loader.js:582
throw err;
^Error: Cannot find module 'C:\Users\Casper\Documents\GitHub\Redacted-e'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)
at Function.Module._resolveFilename (pkg/prelude/bootstrap.js:1287:46)
at Function.Module._load (internal/modules/cjs/loader.js:506:25)
at Function.Module.runMain (pkg/prelude/bootstrap.js:1316:12)
at startup (internal/bootstrap/node.js:320:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:659:3)at waitForAlive (C:\Users\Casper\Documents\GitHub\Redacted\node_modules\sync-rpc\lib\index.js:80:11) at start (C:\Users\Casper\Documents\GitHub\Redacted\node_modules\sync-rpc\lib\index.js:40:3) at sendMessage (C:\Users\Casper\Documents\GitHub\Redacted\node_modules\sync-rpc\lib\index.js:117:17) at createClient (C:\Users\Casper\Documents\GitHub\Redacted\node_modules\sync-rpc\lib\index.js:157:27) at Object.<anonymous> (C:\Users\Casper\Documents\GitHub\Redacted\node_modules\sync-request\lib\index.js:16:14) at Module._compile (internal/modules/cjs/loader.js:699:30) at Module._compile (pkg/prelude/bootstrap.js:1222:32) at Object.Module._extensions..js (internal/modules/cjs/loader.js:710:10) at Module.load (internal/modules/cjs/loader.js:598:32) at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
Any suggestions on how to solve this?
If you need more information, please reply.
And is there any way to change the icon for the windows executable?
Solved
@BitesizedLion how did u fix it
@BitesizedLion Please, can you tell us how did you solved the issue?
@BitesizedLion how did u fix it
@BitesizedLion Please, can you tell us how did you solve the issue?
This was ages ago and I am pretty sure it was just an npm module that messed up.
Specifically sync-request
Solved
This is a horrible crime, sir
Most helpful comment
@BitesizedLion Please, can you tell us how did you solved the issue?