Running node -webkit as a node.js application

Is there a way to node.jshost node-webkit as the host?

I use Intellij IDEA to develop node.js and it has the best debugger for node atm. But node -webkit presents its own nw.exe process, which cannot be debugged by the normal node.js. Other debugging options (chrome devtools) do not match performance with IDEA debugging.

IDEA provides some support for nw debugging, but its very crude and works with many crashes and does not work for many things.

So, I want to develop a node-webkit application that runs under the control of the node.js process, for example appjs.

+4
source share
1 answer

This can be done if you manage to run nw.exe in debug mode with child_process.execand make sure that the line "Debugger listening on port [nnnnn]" is written to stderr, because according to https://youtrack.jetbrains.com/issue/ WEB-1919 # comment = 27-556387

The IDE analyzes it and can understand that a new debugging session needs to be initialized and which debug port.

That would be enough BUT the problem:

  • child_process.exec will not return stderr until the child process is complete and will not provide a way to pass it to host node.js.

  • node -webkit provides only a parameter --remote-debugging-portto specify the port for opening the devtools debugger; there is no way to run in debug mode (something like --debugor --debug-brk)

+1
source

All Articles