2019-11-05 14:55:08 -05:00
|
|
|
---
|
2019-11-18 21:01:39 +02:00
|
|
|
section: cli-commands
|
2019-11-05 14:55:08 -05:00
|
|
|
title: npm-restart
|
|
|
|
description: Restart a package
|
|
|
|
---
|
2011-11-21 09:48:45 -08:00
|
|
|
|
2019-11-18 21:01:39 +02:00
|
|
|
# npm-restart(1)
|
2011-11-21 09:48:45 -08:00
|
|
|
|
2019-11-05 14:55:08 -05:00
|
|
|
## Restart a package
|
2011-11-21 09:48:45 -08:00
|
|
|
|
2019-11-05 14:55:08 -05:00
|
|
|
### Synopsis
|
|
|
|
|
|
|
|
```bash
|
|
|
|
npm restart [-- <args>]
|
|
|
|
```
|
|
|
|
|
|
|
|
### Description
|
2011-11-21 09:48:45 -08:00
|
|
|
|
2015-01-08 14:37:26 -08:00
|
|
|
This restarts a package.
|
|
|
|
|
|
|
|
This runs a package's "stop", "restart", and "start" scripts, and associated
|
|
|
|
pre- and post- scripts, in the order given below:
|
|
|
|
|
|
|
|
1. prerestart
|
|
|
|
2. prestop
|
|
|
|
3. stop
|
|
|
|
4. poststop
|
|
|
|
5. restart
|
|
|
|
6. prestart
|
|
|
|
7. start
|
|
|
|
8. poststart
|
|
|
|
9. postrestart
|
|
|
|
|
2019-11-05 14:55:08 -05:00
|
|
|
### Note
|
2015-01-08 14:37:26 -08:00
|
|
|
|
|
|
|
Note that the "restart" script is run **in addition to** the "stop"
|
|
|
|
and "start" scripts, not instead of them.
|
|
|
|
|
|
|
|
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
|
2011-11-21 09:48:45 -08:00
|
|
|
|
2019-11-05 14:55:08 -05:00
|
|
|
### See Also
|
2011-11-21 09:48:45 -08:00
|
|
|
|
2020-10-02 17:52:19 -04:00
|
|
|
* [npm run-script](/cli-commands/run-script)
|
2019-11-18 21:01:39 +02:00
|
|
|
* [npm scripts](/using-npm/scripts)
|
2020-10-02 17:52:19 -04:00
|
|
|
* [npm test](/cli-commands/test)
|
|
|
|
* [npm start](/cli-commands/start)
|
|
|
|
* [npm stop](/cli-commands/stop)
|
|
|
|
* [npm restart](/cli-commands/restart)
|