node.js - 如何通过 pm2 启动 actionhero
问题描述
我通过这个命令开始行动英雄
pm2 start .\node_modules\actionhero\bin\actionhero
但是 actionhero 没有成功启动,这在我的 pm2 日志中:
错误:在此项目中找不到配置目录,用 --config 指定,或在 process.env.ACTIONHERO_CONFIG 中找到
解决方案
我没有使用 actionhero 的经验,但它清楚地表明找不到配置目录。要么 1. --config 参数必须作为 pm2 start 的下一个参数传递,要么 2. 将环境变量 ACTIONHERO_CONFIG 设置为适当的值。
When launching ActionHero you can specify which config directory to use with --config '/path/to/dir' or the environment variable ACTIONHERO_CONFIG, otherwise ./config/ will be used from your working directory.
The priority of arguments is:
Use the project's ./config folder, if it exists.
actionhero --config=PATH1 --config=PATH2 --config=PATH3,PATH4
ACTIONHERO_CONFIG=PATH1,PATH2 npm start
Note that if --config or ACTIONHERO_CONFIG are used, they overwrite the use of the default /config folder. If you wish to use both, you need to re-specify "config", e.g. --config=config,local-config. Also, note that specifying multiple --config options on the command line does exactly the same thing as using one parameter with comma separators, however the environment variable method only supports the comma-delimited syntax.
推荐阅读
- python - 如何标准化 matplotlib 直方图中的概率分布值?
- mysql - MySQL View 在单列中显示多列中的行
- c++ - vscode 上的 C++:调试得到错误,但运行没有调试的代码仍在运行
- apache-kafka - 如何在 Apache Kafka 中删除用户?
- spring - 代码更改时 Docker 未重新启动
- zipkin - Jaeger 操作员使用无效的 COLLECTOR_ZIPKIN_HTTP_PORT 环境变量创建部署
- json - 在特定模式之后获取字符串的字符并在下一个模式之前结束它
- powerbi - Power BI Right 函数不允许计算长度
- pip - PyTorch 的几何安装问题。“火炬分散”产生退出状态为 1 的错误
- airflow - Airflow:为什么 DAG 任务运行过时的 DAG 代码?