Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google cloud platform 重新启动NodeJS应用程序的启动脚本不工作_Google Cloud Platform - Fatal编程技术网

Google cloud platform 重新启动NodeJS应用程序的启动脚本不工作

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

我正在尝试使用启动脚本meta在实例重置时自动启动服务器

启动脚本运行,但我需要的实际命令不起作用。我在这个脚本中做错了什么

#! /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”时忽略启动脚本吗?