There are no notifications for child_process on error and on exit using spawn

This is my code that perfectly works in vscode.

const execResult = spawn(cmd, args, options);
return new Promise(resolve => {
execResult.stdout.on(‘data’, (data: string) => {
// …

    execResult.stderr.on('data', (data: string) => {
        // ...

    execResult.on('exit', (code: number) => {
        // ...

    execResult.on('error', (err: any) => {
        // ...

Unfortunately in Theia i get only notifications for execResult.stderr.on(‘data’, and execResult.stderr.on(‘data’, .
I never get notification for execResult.on(‘exit’,… and execResult.on(‘exit’ …
Is it a known issue ?


[original thread by Stanislav Lvovsky]

How (where) are you running this code? Front-end, back-end, a plugin?

[Stanislav Lvovsky]

I run this code as vscode extension (.vsix). It runs from a command that i have created.

that’s strange, vscode extension is running in Node.js process, so it should work.

Could you file an issue with your extension?