npm Scripts & Workspaces/Pass args to a script

Pass additional arguments after `--`.

Section: Scripts and lifecycle

Pass args to a script

bash
bash
npm run build -- --watch
Explanation

Pass additional arguments after `--`.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Scripts and lifecycle
Run a named script
Run a package.json script.
OpenIn sheetbashsame section
Run a script quietly
Reduce npm log noise when running scripts.
OpenIn sheetbashsame section
Run test script
Shortcut for `npm run test`.
OpenIn sheetbashsame section
Run start script
Shortcut for `npm run start`.
OpenIn sheetbashsame section
Run stop script
Shortcut for `npm run stop`.
OpenIn sheetbashsame section
Rebuild native modules
Rebuild packages with install scripts or native addons.
OpenIn sheetbashsame section