question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"npm start" stops immediately when run as background job

See original GitHub issue

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® Core™ 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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
backuscommented, 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

0reactions
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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to run Node.js as a background process and never die?
js module, forever. It will run node. js server as daemon service. In my case nohup works when I exit Terminal by typing...
Read more >
How to npm run start at the background ⭐️ | by Ido Montekyo
How to npm run start at the background ⭐️. So I have a (Vue/Angular/React).JS web application and I need to run it in...
Read more >
Why We Stopped Using 'npm start' for Child Processes
The only way to stop this process is by using a shell command that kills all Node processes: 'sudo killall node' (or target...
Read more >
npm-stop
This runs a predefined command specified in the "stop" property of a package's "scripts" object. Unlike with npm start, there is no default...
Read more >
How to stop running npm process on the terminal shell
You need to select the running shell window, then press CTRL + C to stop the process. You should see a new line...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found