run
npm start
Shortcut for `npm run start` — runs the `start` script from package.json. If no `start` script is defined, npm falls back to `node server.js`.
npm start [-- <args>] Common flags
| Flag | Purpose |
|---|---|
| -- | Forward remaining arguments to the start script |
| --workspace <name> (-w) | Start a specific workspace |
| --silent (-s) | Suppress npm's own log framing |
| --ignore-scripts | Skip prestart/poststart lifecycle hooks |
Examples
npm start Run the start script defined in package.json
npm start -- --port=4000 Pass a port flag through to the app
npm start -w apps/web Start the workspace package apps/web
Gotcha
`npm start` is literal sugar for `npm run start`, so `prestart` and `poststart` hooks still fire. If you have no `start` script AND no `server.js`, the command errors out.
Related commands
npm run
Executes a script from the `scripts` block of package.json in a shell where node_modules/.bin is on PATH. Alias: `run-script`; running `npm run` with no arg lists every available script.
npm test
Shortcut for `npm run test` — runs the `test` script from package.json. Aliases: `npm t`, `npm tst`.
npm exec (npx)
Runs a package's binary from a local install, the cache, or on-the-fly from the registry without a global install. `npx` is the shell-friendly shim; both are equivalent in npm 10+.