pm2配置文件解析不了$HOME环境变量?
为了通用,pm2的test.config.js配置文件中含有$HOME变量: module.exports = { “apps”: [ { “name”: “Api”, “script”: “$HOME/Api/startApi.js”, “exec_mode”: “fork”, “err_file”: “$HOME/.pm2/logs/Api_err.log”, } ] };
结果运行的时候,pm2 start test.config.js 。发现无法展开$HOME变量,直接报错: script not found : /Users/xxx/yyy/$HOME/Api/startApi.js