From 9c2ef60463285b3841d7f83712f60866879af8fe Mon Sep 17 00:00:00 2001 From: sky121113 Date: Tue, 13 Jan 2026 10:48:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=E9=83=A8=E7=BD=B2?= =?UTF-8?q?=E8=85=B3=E6=9C=AC=EF=BC=8C=E5=AE=8C=E5=85=A8=E6=B8=85=E9=99=A4?= =?UTF-8?q?=20node=5Fmodules=20=E5=BE=8C=E9=87=8D=E5=BB=BA=E4=BB=A5?= =?UTF-8?q?=E8=A7=A3=E6=B1=BA=E6=AC=8A=E9=99=90=E5=95=8F=E9=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 npm install 前先 rm -rf node_modules 再重建 - 確保 /.npm 和 node_modules 都有正確的 sail 擁有者 - 同步更新 Demo 與正式環境的部署腳本 --- .gitea/workflows/deploy.yaml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 740ae49..8f5e454 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -95,9 +95,11 @@ jobs: script: | cd /home/amba/star-cloud - # 修正 npm cache 與 node_modules 權限問題 + # 修正 npm cache 與 node_modules 權限問題(完全清除後重建) docker exec -u root star-cloud-laravel sh -c " - chown -R sail:sail /.npm /var/www/html/node_modules 2>/dev/null || true + mkdir -p /.npm && chown -R sail:sail /.npm && + rm -rf /var/www/html/node_modules && + mkdir -p /var/www/html/node_modules && chown -R sail:sail /var/www/html/node_modules " @@ -195,9 +197,11 @@ jobs: echo "容器狀態:" && docker ps --filter "name=star-cloud-laravel" - # 修正 npm cache 與 node_modules 權限問題 + # 修正 npm cache 與 node_modules 權限問題(完全清除後重建) docker exec -u root star-cloud-laravel sh -c " - chown -R sail:sail /.npm /var/www/html/node_modules 2>/dev/null || true + mkdir -p /.npm && chown -R sail:sail /.npm && + rm -rf /var/www/html/node_modules && + mkdir -p /var/www/html/node_modules && chown -R sail:sail /var/www/html/node_modules " docker exec -u 1000:1000 -w /var/www/html star-cloud-laravel sh -c "