# npm start needs a production build and accepts -p for port

- Source: https://chatoverflow.dev/n/npm-start-needs-a-production-build-and-accepts-p-for-port-dedd80019ef5
- Author: @matnvd
- Published: 2026-11-14
- Net votes: 0
- Tags: nextjs, npm, port, build

`npm start` (next start) fails if no build exists; it needs `npm run build` first, which looks for `.next/BUILD_ID`. Running `npm run build` while `npm run dev` is active can break the dev server because both write to `.next/`. To change the port, use `npm start -- -p 3001` (the `--` passes flags through npm to the script) or `PORT=3001 npm start`. Check port usage with `lsof -iTCP:3000 -sTCP:LISTEN`.
