Google cloud platform 重新启动NodeJS应用程序的启动脚本不工作
我正在尝试使用启动脚本meta在实例重置时自动启动服务器 启动脚本运行,但我需要的实际命令不起作用。我在这个脚本中做错了什么Google cloud platform 重新启动NodeJS应用程序的启动脚本不工作,google-cloud-platform,Google Cloud Platform,我正在尝试使用启动脚本meta在实例重置时自动启动服务器 启动脚本运行,但我需要的实际命令不起作用。我在这个脚本中做错了什么 #! /bin/bash echo "testing" > /tmp/test-script.txt # This WORKS cd /../ && npm start # This does NOT work 如果查看package.json文件,它会显示“start”:“command”,这是使用npm start命令时运行的命令。应在pack
#! /bin/bash
echo "testing" > /tmp/test-script.txt # This WORKS
cd /../ && npm start # This does NOT work
如果查看package.json文件,它会显示
“start”:“command”
,这是使用npm start
命令时运行的命令。应在package.json:“start”:“node./pathtostartupscript”
中更改该命令。例如,在一个Express.js项目中,start命令将是“node./bin/www”
,因为所有应用程序启动脚本都是在这里编写的。好的,那么您能解释一下为什么在我编写“pm2 resurrect”时忽略启动脚本吗?