我使用 npm start 启动了一个 React 应用程序,并在 package.json 中定义了 start:
{
"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"
}
}
我现在想停止它,而不关闭终端。我怎么做?
尝试过: npm stop testrectapp 但这会引发需要脚本的错误
然后尝试: npm run stop with script "stop": "pkill --signal SIGINT testreactapp" 抛出错误'pkill 未被识别为命令'
编辑:在 bash 中运行 ps 显示:
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>
在那里看不到应用程序?