railsware / bozon

🛠 Command line tool for building, testing and publishing modern Electron applications
MIT License
758 stars 52 forks source link

Application not starting #26

Closed prappo closed 5 years ago

prappo commented 8 years ago

After creating project i tried this command bozon start but nothing happens . I'm using windows

alchaplinsky commented 8 years ago

@prappo Which version of bozon are you using?

lvdaqian commented 8 years ago

I met the same issue. with windows 10 64bit. bozon version is 0.5.4.

lvdaqian commented 8 years ago

I have found the root cause for my case. There are two main issue in may case.

  1. NODE_PATH. When I run gulp directly, it report that can't find bozon/lib/building/tasks. But I have install the bozon globally. From http://stackoverflow.com/questions/9587665/nodejs-cannot-find-installed-module-on-windows, I set the NODE_PATH, it works when run gulp prepare:app --platform=windows --env=development directly.
  2. child_process.spawnSync may run the wrong command. In my node_module.bin, there is only gulp and gulp.cmd, electron and electron.cmd. no gulp.exe and electron.exe. I am not sure whether there is the exe files in other nodejs versions. From the issue of node: https://github.com/nodejs/node-v0.x-archive/issues/2318 , node will automatically add .exe after the command. I try to add .cmd follow the command directly. script of bozon\lib\utiles\bozon.js like this:
  spawnSync: function (command, options) {
    return childProcess.spawnSync(command + ".cmd", options, {
      shell: true,
      stdio: 'inherit'
    })
  },

It works for me now. This only works for windows and will break other platform. There is a solution for cross-spawn https://github.com/IndigoUnited/node-cross-spawn. I think bozon should use this module instead of child_process.spawnSync.