dhei/classic-tokens
@reggi/path-to-regexp
dependabot/npm_and_yarn/main/copy-to-clipboard-4.0.2
dependabot/npm_and_yarn/main/eslint-10.4.0
dependabot/npm_and_yarn/main/npmcli/eslint-config-7.0.0
dependabot/npm_and_yarn/main/proc-log-7.0.0
dependabot/npm_and_yarn/npm_and_yarn-826852524d
dependabot/npm_and_yarn/npm_and_yarn-ab9a7f4bc2
deprecate-totp-2fa
dhei/classic-tokens
gat-bypass-2fa-docs
jpg619/fix-accessibility-content-flow
jpg619/version-bump-tar-2
kartykp/gat-bypass-2fa-docs
kartykp/upgrade-path-to-regex
main
maitxn/version-bump-tar
patch-1
reggi/cache-based-on-version
reggi/dev-engines
reggi/fix-transform-prettier
reggi/overrides
update-search-sensitivity
| 1 | --- |
| 2 | title: npm-restart |
| 3 | section: 1 |
| 4 | description: Restart a package |
| 5 | github_repo: npm/cli |
| 6 | github_branch: release/v6 |
| 7 | github_path: docs/content/commands/npm-restart.md |
| 8 | redirect_from: |
| 9 | - /cli-documentation/v6/cli-commands/npm-restart |
| 10 | - /cli-documentation/v6/cli-commands/restart |
| 11 | - /cli-documentation/v6/commands/npm-restart |
| 12 | - /cli-documentation/v6/commands/restart |
| 13 | - /cli-documentation/v6/npm-restart |
| 14 | - /cli-documentation/v6/restart |
| 15 | - /cli/v6/cli-commands/npm-restart |
| 16 | - /cli/v6/cli-commands/restart |
| 17 | - /cli/v6/commands/restart |
| 18 | - /cli/v6/npm-restart |
| 19 | - /cli/v6/restart |
| 20 | --- |
| 21 | |
| 22 | ### Synopsis |
| 23 | |
| 24 | ```bash |
| 25 | npm restart [-- <args>] |
| 26 | ``` |
| 27 | |
| 28 | ### Description |
| 29 | |
| 30 | This restarts a package. |
| 31 | |
| 32 | This runs a package's "stop", "restart", and "start" scripts, and associated pre- and post- scripts, in the order given below: |
| 33 | |
| 34 | 1. prerestart |
| 35 | 2. prestop |
| 36 | 3. stop |
| 37 | 4. poststop |
| 38 | 5. restart |
| 39 | 6. prestart |
| 40 | 7. start |
| 41 | 8. poststart |
| 42 | 9. postrestart |
| 43 | |
| 44 | ### Note |
| 45 | |
| 46 | Note that the "restart" script is run **in addition to** the "stop" and "start" scripts, not instead of them. |
| 47 | |
| 48 | This is the behavior as of `npm` major version 2. A change in this behavior will be accompanied by an increase in major version number |
| 49 | |
| 50 | ### See Also |
| 51 | |
| 52 | - [npm run-script](/cli/v6/commands/npm-run-script) |
| 53 | - [npm scripts](/cli/v6/using-npm/scripts) |
| 54 | - [npm test](/cli/v6/commands/npm-test) |
| 55 | - [npm start](/cli/v6/commands/npm-start) |
| 56 | - [npm stop](/cli/v6/commands/npm-stop) |
| 57 | - [npm restart](/cli/v6/commands/npm-restart) |