bun icon indicating copy to clipboard operation
bun copied to clipboard

Invalid stdio option "[object EventEmitter]"

Open Eltik opened this issue 1 year ago • 11 comments

What version of Bun is running?

1.0.3+bab9889601eb13c01ebadb1f47752298259700b6

What platform is your computer?

Darwin 22.4.0 arm64 arm

What steps can reproduce the bug?

Using the repository here, running a basic pm2 script like the following results in Invalid stdio option.

import pm2 from "pm2";

pm2.start(
    {
        script: `node`,
        args: "myScript.js",
        name: "testing"
    },
    (err, apps) => {
        if (err) {
            console.log(err);
        } else {
            console.log("running");
        }
    }
);

This seems to be mainly an issue with pm2, but I think this is also related to Node.js compatibility with Stream stdio missing.

image

What is the expected behavior?

No response

What do you see instead?

No response

Additional information

No response

Eltik avatar Sep 18 '23 14:09 Eltik

+1 seeing this when running bunx cdk synth

ferdy-roz avatar Sep 19 '23 00:09 ferdy-roz

Error updated slightly! Says Invalid stdio option "ipc" now rather than just Invalid stdio option if it helps. image

Eltik avatar Sep 21 '23 14:09 Eltik

I hate to bother since it's only been a few days, but does anyone know if there's any updates on this issue?

Eltik avatar Sep 24 '23 15:09 Eltik

On the latest bun I now get

Error: Invalid stdio option "[object EventEmitter]"

ferdy-roz avatar Oct 03 '23 16:10 ferdy-roz

I too am seeing Error: Invalid stdio option "[object EventEmitter]". In my case, it is when running nodemon in the package.json dev script with bun --bun run dev, and the error was the same in 1.0.3 as in 1.0.4.

More context if helpful: https://github.com/hwy-js/hwy/issues/4.

[nodemon] 3.0.1
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): .dev/refresh.txt
[nodemon] watching extensions: js,mjs,cjs,json
[nodemon] starting `node dist/main.js`
Error: Invalid stdio option "[object EventEmitter]"
    at <anonymous> (node:child_process:355:24)
    at map (:1:11)
    at spawn (node:child_process:610:8)
    at <anonymous> (node:child_process:2:21)
    at run (/home/sjc/hwy-bun-test-104/node_modules/nodemon/lib/monitor/run.js:146:23)
    at <anonymous> (/home/sjc/hwy-bun-test-104/node_modules/nodemon/lib/nodemon.js:243:9)
    at <anonymous> (/home/sjc/hwy-bun-test-104/node_modules/nodemon/lib/config/index.js:82:7)
    at processTicksAndRejections (:55:39)
error: Invalid stdio option "[object EventEmitter]"
      at node:child_process:356:24

sjc5 avatar Oct 03 '23 22:10 sjc5

Getting this issue: Error: Invalid stdio option "[object EventEmitter]" when trying to deploy CDK stack using bun: bun cdk/stack.ts

vitalii-kyktov avatar Oct 04 '23 09:10 vitalii-kyktov

I too am seeing Error: Invalid stdio option "[object EventEmitter]". In my case, it is when running nodemon in the package.json dev script with bun --bun run dev, and the error was the same in 1.0.3 as in 1.0.4.

I have a similar situation, in nodemon. However, it only is affected when running in fish. When I start the same process in plain bash, the issue does not occur.

bun version 1.0.14, Ubuntu 23.10, nodemon 2.0.22

mroeling avatar Nov 23 '23 07:11 mroeling

I faced following error when using pm2 with bun:

[PM2] Spawning PM2 daemon with pm2_home=/home/ubuntu/.pm2
251 |   var interpreter = 'node';
252 |
253 |   if (which('node') == null)
254 |     interpreter = process.execPath;
255 |
256 |   var child = require('child_process').spawn(interpreter, node_args, {
                          ^
error: Invalid stdio option "ipc"
      at node:child_process:355:47
      at map (:1:21)

And installing Node.js runtime resolved the issue.

velopert avatar Dec 12 '23 00:12 velopert

Still getting this issue and don't really want to download Node on my server for this.

buenobunny avatar Jan 06 '24 00:01 buenobunny

same here, seems bun not ready yet.

janis332 avatar Jan 07 '24 05:01 janis332

Does this still reproduce for you? it appears to be working for me in Bun 1.1.8. (you may need to run bun upgrade)

nektro avatar May 17 '24 03:05 nektro