JMS*_*786 11 npm reactjs serve
我已经构建了React Apps:
npm run build
Run Code Online (Sandbox Code Playgroud)
并安装全局服务包:
npm install -g serve
Run Code Online (Sandbox Code Playgroud)
并运行它:
serve -s build
Run Code Online (Sandbox Code Playgroud)
我怎么阻止它?
我试过serve help但它没有显示任何停止选项
选项:
Run Code Online (Sandbox Code Playgroud)-a, --auth Serve behind basic auth -c, --cache Time in milliseconds for caching files in the browser -n, --clipless Don't copy address to clipboard (disabled by default) -C, --cors Setup * CORS headers to allow requests from any origin (disabled by default) -h, --help Output usage information -i, --ignore Files and directories to ignore -o, --open Open local address in browser (disabled by default) -p, --port <n> Port to listen on (defaults to 5000) -S, --silent Don't log anything to the console -s, --single Serve single page applications (sets `-c` to 1 day) -u, --unzipped Disable GZIP compression -v, --version Output the version number
您可以像控制其他任何进程一样在控制台上停止该进程:Ctrl + c.
请参阅https://superuser.com/questions/103909/how-to-stop-a-process-in-terminal
使用服务为我的React应用(从create-react-app构建)的生产构建提供服务时,我遇到了同样的问题。
我终于可以通过在文件系统的其他位置(例如主目录)再次使用serve来杀死它,然后使用:杀死它Ctrl + c。
您可以执行以下操作来杀死通过serve服务的 react应用:
> cd ~
> serve
Run Code Online (Sandbox Code Playgroud)
然后用 Ctrl + c
然后转到http:// localhost:5000确认没有提供任何服务。
| 归档时间: |
|
| 查看次数: |
15748 次 |
| 最近记录: |