尝试运行它时出现错误:
~/projects/test-app
/usr/local/bin/meteor:3
# This is the script that we install somewhere in your $PATH (as "meteor")
这是我运行的命令:
pm2 start meteor-pm2.json
这是meteor-pm2.json:
{
"name" : "test-app",
"script" : "/usr/local/bin/meteor",
"MAIL_URL":"smtp://yourmail_configuration_here",
"MONGO_URL":"mongodb://localhost:27017/meteor",
"ROOT_URL":"https://www.mysite.com/",
"PORT":"3000",
"out_file":"/home/josh/logs/app.log",
"error_file":"/home/josh/logs/err.log"
}
我也试试这个: cat start
#!/bin/bash
MONGO_URL="mongodb://localhost:27017/meteor"
PORT=3000
ROOT_URL="https://www.mysite.com/"
/usr/local/bin/meteor
我运行它:
pm2 start ./start -x interpreter bash
我得到:
/usr/local/bin/meteor
^
ReferenceError: usr is not defined
当我通过添加导出来修改 bash 脚本时:
#!/bin/bash
export MONGO_URL="mongodb://localhost:27017/meteor"
export PORT=3000
export ROOT_URL="https://www.mysite.com/"
/usr/local/bin/meteor
我得到:
export - SyntaxError: Unexpected reserved word
任何想法我做错了什么?pm2 是否试图在它自己的不允许使用导出的特殊脚本解释器中运行 bash 脚本?