Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"npm start" stops immediately when run as background job #8956

Closed
moos opened this issue May 4, 2020 · 6 comments · May be fixed by admmasters/create-react-app#34 or joseroubert08/create-react-app#55

Comments

@moos
Copy link
Contributor

moos commented May 4, 2020

Describe the bug

On a fresh install of CRA, running npm start & (in background) stops the job after hitting the Enter key.

Did you try recovering your dependencies?

n/a

Which terms did you search for in User Guide?

"background"

Environment

current version of create-react-app: 3.4.1
running from /Users/foo/.npm/_npx/78633/lib/node_modules/create-react-app

System:
OS: macOS 10.15.4
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Binaries:
Node: 10.20.1 - /var/folders/6v/sfby3s_d0l320yd3hyblj3bc0000gq/T/fnm-shell-7483721/bin/node
Yarn: Not Found
npm: 6.14.4 - /var/folders/6v/sfby3s_d0l320yd3hyblj3bc0000gq/T/fnm-shell-7483721/bin/npm
Browsers:
Chrome: 81.0.4044.129
Firefox: Not Found
Safari: 13.1
npmPackages:
react: ^16.13.1 => 16.13.1
react-dom: ^16.13.1 => 16.13.1
react-scripts: 3.4.1 => 3.4.1
npmGlobalPackages:
create-react-app: Not Found

Steps to reproduce

(Write your steps here:)

  1. npx create-react-app my-app
  2. cd my-app
  3. npm start &
  4. Hit Enter key

It should start the dev server and run it in the (shell) background. It used to work like that.

Actual behavior

It immediately stops the job:

[1]+  Stopped                 npm start

Reproducible demo

n/a

@moos
Copy link
Contributor Author

moos commented May 4, 2020

More info: I believe this is caused by #7203. When I remove that, it runs in the background. The culprit seems to be this line.

Fix for #8688 does not resolve this issue.

@cipriancaba
Copy link

I have the same issue when running start in a yarn monorepo, starting multiple cra apps

@jannikbuschke
Copy link

+1

@backus
Copy link

backus commented Jun 4, 2020

Same. Central to my dev workflow too, so I tinkered a bit. I have a monorepo where a bash script launches about 6 different processes, backgrounds each, then calls wait on each.

Workaround

I changed

BROWSER=none yarn start &

to

BROWSER=none yarn start | cat - &

in my bash script and now create-react-app behaves normally again, albeit without colorized output

@stale
Copy link

stale bot commented Jul 4, 2020

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

@stale stale bot added the stale label Jul 4, 2020
@stale
Copy link

stale bot commented Jul 11, 2020

This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants