[英]Issue passing Node arguments to PM2
我想使用 PM2 啟動一個進程,但它似乎沒有選擇相對於當前工作目錄的節點參數。
從/path/to/dir/
運行它:
pm2 start dist/main.js --node-args="-r ./tsconfig-paths-bootstrap.js" -- -c config.json
而使用這個生態系統文件:
{
"apps": [
{
"name": "server",
"script": "dist/main.js",
"instances": 2,
"exec_mode": "cluster",
"cwd": "/path/to/dir/",
"args": [
"-c",
"config.json"
],
"node_args": [
"-r",
"./tsconfig-paths-bootstrap.js"
],
"watch": false
}
]
}
並運行: pm2 start server
給我以下錯誤: Error: Cannot find module './tsconfig-paths-bootstrap.js'
如何解決這個問題?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.