简体   繁体   English

使用进程文件将 --node-args --inspect 传递给 pm2

[英]Passing --node-args --inspect to pm2 with process file

I'm currently using pm2 with a process file as such:我目前正在使用带有进程文件的pm2 ,如下所示:

pm2 start ecosystem.config.js

I would like to pass in the --inspect flag in order to start the node inspector.我想传入--inspect标志以启动节点检查器。 However, doing this doesn't work:但是,这样做不起作用:

pm2 start ecosystem.config.js --node-args="--inspect"

This page http://pm2.keymetrics.io/docs/usage/application-declaration/#considerations mentions此页面http://pm2.keymetrics.io/docs/usage/application-declaration/#thinkations提及

All command line options passed when using the JSON app declaration will be dropped ie使用 JSON 应用程序声明时传递的所有命令行选项都将被删除,即

Is this the reason that this isn't working.这是不起作用的原因吗。 Does anyone know why?有谁知道为什么?

Is there a way to pass in the the --inspect flag without adding it to the process file?有没有办法传入--inspect标志而不将其添加到进程文件中? I'm aware that adding the node_args property to the process file work.我知道将node_args属性添加到进程文件工作。 I'm trying to figure out if there's a way to get CLI option to work.我想弄清楚是否有办法让 CLI 选项起作用。

According to the docs you should be able to do this: 根据文档,您应该能够做到这一点:

pm2 start ecosystem.config.js -- --inspect

Quoting:引用:

Pass extra arguments to the script将额外的参数传递给脚本

-- arg1 arg2 arg3 -- arg1 arg2 arg3

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM