Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How stop after running react-scripts start?

I started a React app with npm start with start defined in package.json:

{    "name": "testreactapp",    "version": "0.1.0",    "private": true,    "dependencies": {      "react": "^15.6.1",      "react-dom": "^15.6.1",      "react-scripts": "1.0.10"    },    "scripts": {      "start": "react-scripts start",      "build": "react-scripts build",      "test": "react-scripts test --env=jsdom",      "eject": "react-scripts eject"    }  }

I want to stop it now, without closing the terminal. How do I do that?

Tried: npm stop testrectapp but that throws error that it needs a script

Then tried: npm run stop with script "stop": "pkill --signal SIGINT testreactapp" that throws error 'pkill is not recognized as a command'

Edit: running ps in bash shows: PID PPID PGID WINPID TTY UID STIME COMMAND 6652 1 6652 6652 ? 197612 19:52:49 /usr/bin/mintty 1092 1 1092 1092 ? 197612 Jul 25 /usr/bin/mintty 11092 6652 11092 10060 pty1 197612 19:52:49 /usr/bin/bash 13868 1092 13868 992 pty0 197612 Jul 25 /usr/bin/bash 11428 13868 11428 17340 pty0 197612 12:48:27 /usr/bin/ps 11672 1092 1092 11672 ? 197612 Jul 25 /usr/bin/mintty <defunct> Don't see the app there?

like image 965
user1837293 Avatar asked Aug 07 '17 09:08

user1837293


People also ask

How do you stop React-scripts start?

To stop this from running, in the command prompt, type CTRL-C. You will get the prompt to Terminate batch job: Type Y and the app will stop running: You can now run npm start again if you want to relaunch the app.

How stop npm start React?

To create a production build, run npm run build. You need to select the running shell window, then press CTRL + C to stop the process. Alternatively, you can close the shell window to stop the running process immediately. This can be useful when the running process is lagging and pressing CTRL + C isn't working.

What is start React-scripts start?

start. React uses Node. js on development to open the app on http://localhost:3000 , thus the start script enables you to start the webpack development server. You can run the start script command on the terminal with either npm or yarn : yarn start npm start.

How do I restart a React project?

Drag the file Restart. xcodeproj from /node_modules/react-native-restart/ios into the Libraries group in the Project navigator. Ensure that Copy items if needed is UNCHECKED!


Video Answer


1 Answers

Hit your keyboard shortcut for stopping terminal commands (usually Ctrl+C or Ctrl+Q)

Or, if you don't have input access to the process, identify its PID and kill it :

On Windows :

C:\>Taskkill /PID <PID> /F 

On Linux :

$>kill -SIGTERM <PID> 
like image 77
Antoine Auffray Avatar answered Sep 26 '22 10:09

Antoine Auffray