open-cli-tools / concurrently

Run commands concurrently. Like `npm run watch-js & npm run watch-less` but better.
https://www.npmjs.com/package/concurrently
MIT License
6.98k stars 227 forks source link

Exiting with code 1 on Linux #489

Closed BuckyBuck135 closed 1 month ago

BuckyBuck135 commented 2 months ago

Hi everyone, Running this command npm run dev with this script "dev": "concurrently \"decap-server\" \"astro dev\"", Does not launch the servers, but rather exists with this message:

$ npm run dev

> intermediate-astro-kit-less@1.0.0 dev
> concurrently "decap-server" "astro dev"

[0] decap-server exited with code 1
[1] astro dev exited with code 1

OS: Ubuntu 22.04.4 LTS "concurrently": "^8.2.2" "node": "10.8.1" IDE: VScode

Sorry, I'm not too sure how to give a reproducible example. The same script on the same repo works perfectly fine on Windows 11. Wondering if this is an issue with Ubuntu? Thank you for your time.

gustavohenke commented 1 month ago

Hey, do you not have any other output? I'd expect that whatever is making the child processes exit would've printed something else, so that we can know what's wrong.

BuckyBuck135 commented 1 month ago

Hi @gustavohenke, thanks for your message, and sorry for the late response. No, there wasn't any other input. I ended up not using concurrently altogether. instead, I used this: "dev": "npm run astro dev & npx decap-server", and it's working fine. Will close the issue.

FinzyPHINZY commented 3 weeks ago

I've got a similar issue.

`

mernmunch-backend@1.0.0 dev concurrently --verbose "nodemon" "npm run stripe"

[0] npm run stripe exited with code 1`

How do i fix the bug

FinzyPHINZY commented 3 weeks ago

weirdly, It works when i add the --raw flag but this won't fly in deployment

gustavohenke commented 3 weeks ago

@FinzyPHINZY are you able to create a small reproduction repository for me?

but this won't fly in deployment

As in, it doesn't work in your deployment script, or you can't use --raw during deployment for some other reason?

FinzyPHINZY commented 3 weeks ago

@FinzyPHINZY are you able to create a small reproduction repository for me?

but this won't fly in deployment

As in, it doesn't work in your deployment script, or you can't use --raw during deployment for some other reason?

you can access the repo here. it's a personal project.Click here

Even on my local machine, it doesn't work. but if i add the --raw flag. it works. and that doesn't even make any sense because it's supposed to only affect styling on the output.

if i run my commands individually without using concurrently, it works.

i'll love to talk about this

gustavohenke commented 3 weeks ago

Hey, looks like your project is a bit hard to setup as it requires a few configurations before the project can run without crashing first (stripe configuration, mongodb server, etc) - are you able to trim it down, so that it's easier to reproduce?

Also, which OS are you using?

if i add the --raw flag. it works. and that doesn't even make any sense because it's supposed to only affect styling on the output

That's not true. Raw mode makes the children processes inherit the same stdout/stderr as concurrently, hence why output cannot be captured, whereas non-raw mode creates a pipe between the children. Some docs here. This difference might also influence in how the children program work, as they can detect if they are being piped or not and adapt their behaviour.