简体   繁体   English

无法启动 Clinic.js,我该怎么办?

[英]Can't start Clinic.js, what should I do?

At startup: clinic doctor --on-port 'autocannon -m POST localhost:8000/users/register' -- node dist/main.js启动时: clinic doctor --on-port 'autocannon -m POST localhost:8000/users/register' -- node dist/main.js

Gives help log: Clinic.js Doctor - v9.2.0给出帮助日志:Clinic.js Doctor - v9.2.0

clinic doctor is the first step in profiling your application. clinic doctor 是分析您的应用程序的第一步。 It will show you what kind of problem you are having and recommend the path forward.它会向您展示您遇到的问题类型并推荐前进的道路。

To run clinic doctor跑门诊医生

clinic doctor -- node server.js

Once you exit (Ctrl-C) the process, your report will open in a browser window. You can disable this behavior:退出 (Ctrl-C) 过程后,您的报告将在浏览器 window 中打开。您可以禁用此行为:

clinic doctor --open=false -- node server.js

If profiling on a server, it can be useful to only do data collection:如果在服务器上进行分析,仅进行数据收集可能很有用:

clinic doctor --collect-only -- node server.js

You can then transfer the data and visualize it locally:然后您可以传输数据并在本地可视化它:

clinic doctor --visualize-only PID.clinic-doctor-sample

You can use the --autocannon flag to simulate load on your server.您可以使用 --autocannon 标志来模拟服务器上的负载。 --autocannon accepts configuration for autocannon using "subarg" syntax: --autocannon 接受使用“subarg”语法的 autocannon 配置:

clinic doctor --autocannon [ -m POST /api/example ] -- node server.js

When configuring --autocannon, the $PORT environment variable contains the port your server is listening on:配置 --autocannon 时,$PORT 环境变量包含您的服务器正在侦听的端口:

clinic doctor --autocannon [ -m POST 'http://localhost:$PORT/?\$page=1' ] -- node server.js

Note that dollar signs ($) appearing in the URL must be escaped, else they will be treated as environment variables as well.请注意,出现在 URL 中的美元符号 ($) 必须进行转义,否则它们也将被视为环境变量。

Flags -h |标志 -h | --help Display Help -v | --help 显示帮助 -v | --version Display Version --collect-only Do not process data on termination --visualize-only datapath Build or rebuild visualization from data --sample-interval interval Sample interval in milliseconds --on-port Run a script when the server starts listening on a port. --version 显示版本 --collect-only 终止时不处理数据 --visualize-only datapath 从数据构建或重建可视化 --sample-interval interval 以毫秒为单位的采样间隔 --on-port 在服务器启动时运行脚本监听一个端口。 --autocannon Run the autocannon benchmarking tool when the server starts listening on a port. --autocannon 当服务器开始侦听端口时运行 autocannon 基准测试工具。 --open Boolean to enable or disable your report opening in your web browser. --open Boolean 以启用或禁用在 web 浏览器中打开报告。 --dest Destination for the collected data (default.clinic/). --dest 收集数据的目的地(default.clinic/)。

OS: Windows操作系统:Windows

If you're using Powershell to run it, it will not work.如果您使用 Powershell 来运行它,它将无法运行。 I don't know why exactly but I had the same issue.我不知道为什么,但我遇到了同样的问题。 it's working fine with CMD.它在 CMD 上运行良好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我如何开始学习Ext Js? 我首先能做什么? - How do i start to learn Ext Js ? what first i can do? 外部js如何工作? 从我阅读的内容来看,这为什么行得通呢? - How do external js work?? From what I've read this should work why doesn't it? 我想把 django 的 object 放在模板 JavaScript 中,但是我不能怎么办? - I want to put django's object in the templapates JavaScript, but I can't What should I do? 为什么我不能用 Switch-Case 做我在 JS 中用 If-Else 做的事? - Why I can't do with Switch-Case what I do with If-Else in JS? 我无法使用 Vite 运行我的应用程序。 我应该怎么办? - I can't run my app with Vite. What should I do? 我无法将 Less CSS 加载到我的网站,我该怎么办? - I can't load Less CSS to my website, what should I do? 我无法安装“npm install semantic-ui-react semantic-ui-css”,我该怎么办? - I can't install " npm install semantic-ui-react semantic-ui-css", what should I do? 我无法在主机上启动 node.js - I can't start node.js on hosting 我的网站正在加载我不知道的外部JS。 我能做什么? - My website is loading an external JS that I don't know. What can I do? 我应该怎么做一些我可以在反应中扩展组件? - What should I do some I can extend component in react?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM