diff --git a/server/services/previewDeploy.js b/server/services/previewDeploy.js index 0d73df4..466d75a 100644 --- a/server/services/previewDeploy.js +++ b/server/services/previewDeploy.js @@ -250,11 +250,15 @@ async function deployNodeBuild(sourceDir, targetDir) { timeout: 15 * 60 * 1000, env: { ...process.env, CI: '1' }, } + // Der Server-Container laeuft mit NODE_ENV=production, dadurch setzt npm + // automatisch omit=dev. Die Build-Toolchain (Next, Vite, Tailwind, TypeScript) + // steht aber in den devDependencies -> ohne "--include=dev" bricht jeder + // Build mit "Cannot find module ..." ab (Fall Anelia-Wolf/Next 16). try { - await execFileAsync('npm', ['ci'], execOpts) + await execFileAsync('npm', ['ci', '--include=dev'], execOpts) } catch { // Ohne (passendes) package-lock.json schlaegt npm ci fehl -> npm install. - await execFileAsync('npm', ['install', '--no-audit', '--no-fund'], execOpts) + await execFileAsync('npm', ['install', '--include=dev', '--no-audit', '--no-fund'], execOpts) } await execFileAsync('npm', ['run', 'build'], execOpts)