我使用 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 &
请指导我缺少的地方。
尝试像这样运行它
nohup npx next start &
要对启动脚本进行故障排除,您可以在计算实例上运行以下命令:
journalctl -u google-startup-scripts.service