npm run
package.json command
Syntax
npm run <script> [-- <args>]
Parameters
| Parameters | Description | Examples | Level |
|---|---|---|---|
<script> |
npm run build |
Common | |
-- <args> |
Parameters | npm run test -- --watch |
Common |
(Parameters) |
npm run |
Common | |
start |
npm start npm run start | npm start |
Common |
test |
npm test npm run test | npm test |
Common |
Examples
npm run build
package.json scripts.build command
npm run dev
Parameters
npm run test -- --coverage
-- Parameters
npm run
package.json scripts
Common Errors
Missing script: "xxx"package.json scripts, npm run
sh: command not foundcommand, devDependencies
Tips
- npm start, npm test, npm stop run
- pre/post : pretest test
- npx node_modules/.bin command