2025-04-10 14:36:22 -07:00
.TH "NPM-RESTART" "1" "April 2025" "NPM@11.3.0" ""
2011-11-26 09:21:03 -08:00
.SH "NAME"
2022-12-06 22:18:33 -05:00
\fB npm-restart\fR - Restart a package
.SS "Synopsis"
2014-09-24 14:41:07 -07:00
.P
.RS 2
2014-11-04 15:08:12 -08:00
.nf
2022-12-06 22:18:33 -05:00
npm restart \[ lB]-- <args>\[ rB]
2014-11-04 15:08:12 -08:00
.fi
2014-09-24 14:41:07 -07:00
.RE
2022-12-06 22:18:33 -05:00
.SS "Description"
2014-09-24 14:41:07 -07:00
.P
2022-12-06 22:18:33 -05:00
This restarts a project. It is equivalent to running \fB npm run-script
restart\fR .
2015-01-08 14:37:26 -08:00
.P
2022-12-06 22:18:33 -05:00
If the current project has a \fB "restart"\fR script specified in \fB package.json\fR , then the following scripts will be run:
2020-12-11 18:54:56 -05:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP 1 . 4
2020-12-11 18:54:56 -05:00
prerestart
2022-12-06 22:18:33 -05:00
.IP 2 . 4
2020-12-11 18:54:56 -05:00
restart
2022-12-06 22:18:33 -05:00
.IP 3 . 4
2020-12-11 18:54:56 -05:00
postrestart
2022-12-06 22:18:33 -05:00
.RE 0
2020-12-11 18:54:56 -05:00
.P
2022-12-06 22:18:33 -05:00
If it does \fI not\fR have a \fB "restart"\fR script specified, but it does have \fB stop\fR and/or \fB start\fR scripts, then the following scripts will be run:
2015-01-08 14:37:26 -08:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP 1 . 4
2015-01-08 14:37:26 -08:00
prerestart
2022-12-06 22:18:33 -05:00
.IP 2 . 4
2015-01-08 14:37:26 -08:00
prestop
2022-12-06 22:18:33 -05:00
.IP 3 . 4
2015-01-08 14:37:26 -08:00
stop
2022-12-06 22:18:33 -05:00
.IP 4 . 4
2015-01-08 14:37:26 -08:00
poststop
2022-12-06 22:18:33 -05:00
.IP 5 . 4
2015-01-08 14:37:26 -08:00
prestart
2022-12-06 22:18:33 -05:00
.IP 6 . 4
2015-01-08 14:37:26 -08:00
start
2022-12-06 22:18:33 -05:00
.IP 7 . 4
2015-01-08 14:37:26 -08:00
poststart
2022-12-06 22:18:33 -05:00
.IP 8 . 4
2015-01-08 14:37:26 -08:00
postrestart
2022-12-06 22:18:33 -05:00
.RE 0
2015-01-08 14:37:26 -08:00
2022-12-06 22:18:33 -05:00
.SS "Configuration"
.SS "\fBignore-scripts\fR"
2021-05-20 15:54:50 -04:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2021-05-20 15:54:50 -04:00
Default: false
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2021-05-20 15:54:50 -04:00
Type: Boolean
2022-12-06 22:18:33 -05:00
.RE 0
2021-05-20 15:54:50 -04:00
.P
2022-12-06 22:18:33 -05:00
If true, npm does not run scripts specified in package.json files.
2021-05-20 15:54:50 -04:00
.P
2022-12-06 22:18:33 -05:00
Note that commands explicitly intended to run a particular script, such as \fB npm start\fR , \fB npm stop\fR , \fB npm restart\fR , \fB npm test\fR , and \fB npm run-script\fR will still run their intended script if \fB ignore-scripts\fR is set, but they will \fI not\fR run any pre- or post-scripts.
.SS "\fBscript-shell\fR"
2021-05-20 15:54:50 -04:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
.IP \(bu 4
2021-05-20 15:54:50 -04:00
Type: null or String
2022-12-06 22:18:33 -05:00
.RE 0
2021-05-20 15:54:50 -04:00
.P
2022-12-06 22:18:33 -05:00
The shell to use for scripts run with the \fB npm exec\fR , \fB npm run\fR and \fB npm
init <package-spec>\fR commands.
.SS "See Also"
2014-09-24 14:41:07 -07:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
npm help run-script
.IP \(bu 4
2019-11-18 21:01:39 +02:00
npm help scripts
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2019-11-18 21:01:39 +02:00
npm help test
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2019-11-18 21:01:39 +02:00
npm help start
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2019-11-18 21:01:39 +02:00
npm help stop
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2019-11-18 21:01:39 +02:00
npm help restart
2022-12-06 22:18:33 -05:00
.RE 0