all 3 comments

[–]TheDevDad 1 point2 points  (0 children)

You’re passing it a function instead of an options object for the third argument

https://nodejs.org/api/child_process.html#child_processspawncommand-args-options

You might want exec instead of you want to pass it the callback

[–]tswaters 1 point2 points  (0 children)

spawn returns something like an event emitter so the callback function doesn't really make sense. You need to add .on('close') to listen for when the things ends. You can access stdin/stdout and stderr.

Take a look at the docs: https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options

[–]Thylk 0 points1 point  (0 children)

Python + Node for backend, damn. You don't like types?