2019-11-05 14:55:08 -05:00
|
|
|
---
|
|
|
|
title: npm-restart
|
2020-11-01 07:54:36 +01:00
|
|
|
section: 1
|
2019-11-05 14:55:08 -05:00
|
|
|
description: 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
|
|
|
|
2020-12-11 18:54:56 -05:00
|
|
|
This restarts a project. It is equivalent to running `npm run-script
|
|
|
|
restart`.
|
2015-01-08 14:37:26 -08:00
|
|
|
|
2020-12-11 18:54:56 -05:00
|
|
|
If the current project has a `"restart"` script specified in
|
|
|
|
`package.json`, then the following scripts will be run:
|
|
|
|
|
|
|
|
1. prerestart
|
|
|
|
2. restart
|
|
|
|
3. postrestart
|
|
|
|
|
|
|
|
If it does _not_ have a `"restart"` script specified, but it does have
|
|
|
|
`stop` and/or `start` scripts, then the following scripts will be run:
|
2015-01-08 14:37:26 -08:00
|
|
|
|
|
|
|
1. prerestart
|
|
|
|
2. prestop
|
|
|
|
3. stop
|
|
|
|
4. poststop
|
|
|
|
6. prestart
|
|
|
|
7. start
|
|
|
|
8. poststart
|
|
|
|
9. postrestart
|
|
|
|
|
2019-11-05 14:55:08 -05:00
|
|
|
### See Also
|
2011-11-21 09:48:45 -08:00
|
|
|
|
2020-11-01 07:54:36 +01:00
|
|
|
* [npm run-script](/commands/npm-run-script)
|
2019-11-18 21:01:39 +02:00
|
|
|
* [npm scripts](/using-npm/scripts)
|
2020-11-01 07:54:36 +01:00
|
|
|
* [npm test](/commands/npm-test)
|
|
|
|
* [npm start](/commands/npm-start)
|
|
|
|
* [npm stop](/commands/npm-stop)
|
|
|
|
* [npm restart](/commands/npm-restart)
|