Node.js to electron IPC on linux


#1

I’m unable to make a simple IPC communication between node and spawned electron process working on linux ubuntu. It works fine on Windows.

node.js code

var electron = require('electron-prebuilt')
var spawn = require('child_process').spawn

var child = spawn(electron, ['electron-script.js'], {
  stdio: ['ipc']
})

child.on('message', function (m) {
  console.log('Yes it works!')
})

electron script

process.send('I am ok')
process.exit(0);

On windows I get back Yes it works to console. There seems to be no communication happening and nothing is printed on ubuntu. Thank you for the help.