develephant / phaser-node-kit

Rapid Game Development with PhaserJS and Node for Modern Browsers

Home Page:https://develephant.github.io/phaser-node-kit/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ENOENT

happytomatoe opened this issue · comments

pnkit watch

» Development Mode Activated
events.js:161
throw er; // Unhandled 'error' event
^

Error: spawn light-server ENOENT
at exports._errnoException (util.js:1023:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:359:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
at Module.runMain (module.js:607:11)
at run (bootstrap_node.js:418:7)
at startup (bootstrap_node.js:139:9)
at bootstrap_node.js:533:3

I'm afraid that I've run into this issue, too.

I'm running Node v6.11.0 on Windows 10.

commented

Same for me - i get that error although i've nooodled around and tried various things to resolve.

commented

I thought perhaps my node version wasn't the same as the person who create the guide? Maybe we could try to get the same version installed.

Same problem on Node v6.9.1, Win10.

Same problem on v6.10.0 Win10

pnkit init
seems to not generate package.json file as well.

Same problem here, node v6.9.5 Win7

I found where the problem occurs:
on Windows, the linux version of light-server is spawned.

in C:\Users[UserName]\AppData\Roaming\npm\node_modules\phaser-node-kit\lib\watch.js

replace on line 125:
const lightServer = spawn('light-server', ['-s', dir, '-p', port, '-b', host, '-q'],
{ cwd: path.join(paths.cli.base, 'node_modules', '.bin'), stdio: null } )

with:
const lightServer = spawn('light-server.cmd', ['-s', dir, '-p', port, '-b', host, '-q'],
{ cwd: path.join(paths.cli.base, 'node_modules', '.bin'), stdio: null } )

@6rilme - Thanks for catching that. I will update the source.

Cheers.

not working on windows 7, but great project.

any resolve on this issue? Any help or work around to use this kit would be grateful thanks.

@shallowfoot @olixis @develephant It's been a while, but the fix above by @6rilme works. You'll need to apply it to the other files though, to get the rest of the pnkit commands to work.

  1. Go to the folder C:\Users[UserName]\AppData\Roaming\npm\node_modules\phaser-node-kit\lib
  2. Look in files: build.js (line 42), update.js (line 22)
  3. Replace line any section const npm = spawn('npm', with const npm = spawn('npm.cmd',

The fix with watch.js file above should also work.