igorklopov / enclose

Compile your Node.js project into an executable
http://enclosejs.com
Other
936 stars 43 forks source link

child_process.spwan and commanderjs #56

Closed ainglese closed 7 years ago

ainglese commented 9 years ago

hi, i've built a cli with https://github.com/tj/commander.js, and i'm trying to package it with enclose. when using commander's subcommands, commander starts a node subprocess to execute a js file. problem is subprocess cannot find js modules. any idea if this could be supported by enclose?

var proc = spawn('node', args, { stdio: 'inherit', customFds: [0, 1, 2] });
  proc.on('error', function(err) {
    if (err.code == "ENOENT") {
      console.error('\n  %s(1) does not exist, try --help\n', bin);
    } else if (err.code == "EACCES") {
      console.error('\n  %s(1) not executable. try chmod or run with root\n', bin);
    }
  });
ainglese commented 9 years ago

running enclose with -l info flag, i can see that files are added as code, and not as assets:

eva-modules.js
  info  The file was included into output executable as js code

although i've explicitly told to package it as asset in config:

module.exports = { assets: './eva-*.js' };

ainglese commented 8 years ago

could you give feedback on this? is it supported? or not? only with the payed version? my concerns are if enclose should support commander sub-commands (and i've missed something) or if it's unsupported and i've to found an alternative. thanks for your time on this

igorklopov commented 7 years ago

Dear users of EncloseJS! I highly encourage you to switch to https://github.com/zeit/pkg It is rewritten successor of EncloseJS. It is open source, and all improvements will go there. Please check if pkg has your issue unresolved, and if it is true, reopen your issue there: https://github.com/zeit/pkg/issues