GCP 未运行启动脚本:npm 以 nohup 启动

问题描述 投票:0回答:2

我使用 nextjs 进行服务器端渲染并使用 GCP 进行部署。 我已在 gcp 启动脚本中添加了这些命令,但 npm start 不起作用

实验1

#! /bin/bash

sleep 60; cd /root/path/; nohup npm start &

实验2

#! /bin/bash

sleep 60

cd /root/path/

nohup npm start &

请指导我缺少的地方。

google-cloud-platform devops
2个回答
1
投票

尝试像这样运行它

nohup npx next start &

0
投票

要对启动脚本进行故障排除,您可以在计算实例上运行以下命令:

journalctl -u google-startup-scripts.service
© www.soinside.com 2019 - 2024. All rights reserved.