Build command
- Standard term
A build command prepares a project's source files for a web host to serve. It translates code into a form browsers run, packs many files into a few, writes out pages, and checks for errors.
Your computer's preview prepares each page only when you open it, and it skips slow checks. A build prepares every page with the live site's settings and runs those checks. On the host it starts from only the files you sent, so anything kept only on your computer turns up missing.
Where you’ll meet it
An email from your hosting service says last night's deploy failed. The pricing page your coding agent added looked right in the preview on your computer. The host's log ends with “Module not found,” and visitors still see the site as it was yesterday.
What to do
Ask the agent to download a fresh copy of the project from where the host pulls it, such as GitHub, and run the host's build command there. Have it fix the earliest error first, since later ones often follow from it, and send the fix once the copy builds cleanly.
Easy to mix up
A deployment puts a version of the site online for people to open. A build only prepares the files, and its output stays on whichever machine ran it until something deploys it.
Check yourself
Your host shows “Build succeeded” for the new members-only page. Is the page working for members?
Go deeperThe word names a script, and each project decides what it runs
In most JavaScript projects, the build command is the entry named build in package.json, the file that lists a project's commands and the packages it depends on. That entry usually calls the framework, the ready-made toolkit the site is built with, such as Next.js or Astro, and hosts often detect the framework and fill in the command themselves.
The framework's setup decides which checks a build runs. Type checking, which confirms each value in the code is the kind of data expected there, runs during some builds and is skipped in others.
Hosts keep downloaded packages and earlier output between builds to save time, and a stale copy can make a build pass or fail differently from a clean one, so most hosts offer a redeploy that clears it. Some settings are read during the build and written into the output, so changing one on the host does nothing until the next build.