vercel / pkg

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

win10bug #386

Closed hktalent closed 5 years ago

hktalent commented 6 years ago

win10

pkg mySocks5.js -o myapp.exe  --targets node9-win-x64
> pkg@4.3.0

is ok

test run myapp win7

C:\Users\Administrator\Desktop>myapp.exe
pkg/prelude/bootstrap.js:1172
      throw error;
      ^

Error: Cannot find module 'C:\snapshot\tmp1\node_modules\socksv5/lib/server'
1) If you want to compile the package/file into executable, please pay attention
 to compilation warnings and specify a literal in 'require' call. 2) If you don'
t want to compile the package/file into executable and want to 'require' it from
 filesystem (likely plugin), specify an absolute path in 'require' call using pr
ocess.cwd() or process.execPath.
    at Function.Module._resolveFilename (module.js:540:15)
    at Function.Module._resolveFilename (pkg/prelude/bootstrap.js:1269:46)
    at Function.Module._load (module.js:470:25)
    at Module.require (module.js:583:17)
    at Module.require (pkg/prelude/bootstrap.js:1153:31)
    at require (internal/module.js:11:18)
    at C:\snapshot\tmp1\node_modules\socksv5\index.js:5:13
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (C:\snapshot\tmp1\node_modules\socksv5\index.js:4:32)
    at Module._compile (pkg/prelude/bootstrap.js:1243:22)
mikhail-manuilov commented 6 years ago

For some reason pkg looks for modules under C:\snapshot\tmp1\node_modules\socksv5/lib/server, have you trie to pull myapp.exe under C:\snapshot path and copy modules to C:\snapshot\tmp1\node_modules\socksv5/lib/server ?

zohar1000 commented 6 years ago

hi @hktalent, did you find a solution for it? I'm having the same problem.