{"slug": "missing-script-build-npm-err-when-the-host-builds-your-app", "title": "Missing script: build (npm ERR! when the host builds your app)", "summary": "Axonscape's Launchpad team published guidance on fixing the npm 'Missing script: \"build\"' error that halts deployments when a package.json lacks a build script, recommending framework-specific entries such as \"next build\" for Next.js, \"vite build\" for Vite, and \"tsc\" for TypeScript servers. The team also offers a free launch check that scans a public GitHub repo or code zip for this and other pre-launch failures without retaining data.", "body_md": "The deploy stops at once with npm's 'Missing script: \"build\"' when package.json doesn't say how to build the app. One line in package.json fixes it.\n\nThe host's build log ends with `npm ERR! Missing script: \"build\"`, or the host deploys an empty or unbuilt app.\n\nHosts run `npm run build` (or the same with pnpm, yarn or bun). Apps exported from AI tools, or started from a bare template, sometimes have only a dev script, or none.\n\n`scripts` in `package.json`: `\"build\": \"next build\"` for Next.js, `\"build\": \"vite build\"` for Vite, `\"build\": \"tsc\"` for a TypeScript server.`npm run build` on your computer and fix anything it reports before you deploy again.`index.html`.\nPaste this into Lovable, Bolt, v0, Replit or Cursor:\n\nAdd a build script to package.json that builds this app for production with its framework's own command, run it, and fix any errors it reports.\n\nThe full page, with the request ready to copy, is at [launchpad.axonscape.com/fix/missing-build-script](https://launchpad.axonscape.com/fix/missing-build-script). I work on Launchpad by Axonscape, which runs a [free launch check](https://launchpad.axonscape.com/check) for apps built with AI tools: it finds this and the other things that break at launch, from a public GitHub repo or a .zip of the code, and keeps nothing.", "url": "https://wpnews.pro/news/missing-script-build-npm-err-when-the-host-builds-your-app", "canonical_source": "https://dev.to/axonscape/missing-script-build-npm-err-when-the-host-builds-your-app-649", "published_at": "2026-11-22 09:40:53+00:00", "updated_at": "2026-11-22 09:42:21.280773+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["Axonscape", "Launchpad", "Next.js", "Vite", "npm", "Lovable", "Bolt", "v0"], "also_reported_by": [], "takeaway": "Adding a framework-specific build script (e.g. \"next build\", \"vite build\" or \"tsc\") to package.json and running npm run build locally before deploying prevents the host's 'Missing script: \"build\"' failure.", "recommendation": {"advice": "Add a framework-specific build script to package.json and run npm run build locally, fixing reported errors before redeploying.", "playbook": "production-ops", "playbook_url": "https://wpnews.pro/playbooks/production-ops"}, "alternates": {"html": "https://wpnews.pro/news/missing-script-build-npm-err-when-the-host-builds-your-app", "markdown": "https://wpnews.pro/news/missing-script-build-npm-err-when-the-host-builds-your-app.md", "text": "https://wpnews.pro/news/missing-script-build-npm-err-when-the-host-builds-your-app.txt", "jsonld": "https://wpnews.pro/news/missing-script-build-npm-err-when-the-host-builds-your-app.jsonld"}}