codekingpro/portable-devtools
114k
1---
2title: npm-restart
3section: 1
4description: Restart a package
5---
6
7### Synopsis
8
9```bash
10npm restart [-- <args>]
11```
12
13### Description
14
15This restarts a project.
16It is equivalent to running `npm run restart`.
17
18If the current project has a `"restart"` script specified in `package.json`, then the following scripts will be run:
19
201. prerestart
212. restart
223. postrestart
23
24If it does _not_ have a `"restart"` script specified, but it does have `stop` and/or `start` scripts, then the following scripts will be run:
25
261. prerestart
272. prestop
283. stop
294. poststop
306. prestart
317. start
328. poststart
339. postrestart
34
35### Configuration
36
37#### `ignore-scripts`
38
39* Default: false
40* Type: Boolean
41
42If true, npm does not run scripts specified in package.json files.
43
44Note that commands explicitly intended to run a particular script, such as
45`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still
46run their intended script if `ignore-scripts` is set, but they will *not*
47run any pre- or post-scripts.
48
49
50
51#### `script-shell`
52
53* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
54* Type: null or String
55
56The shell to use for scripts run with the `npm exec`, `npm run` and `npm
57init <package-spec>` commands.
58
59
60
61### See Also
62
63* [npm run](/commands/npm-run)
64* [npm scripts](/using-npm/scripts)
65* [npm test](/commands/npm-test)
66* [npm start](/commands/npm-start)
67* [npm stop](/commands/npm-stop)
68* [npm restart](/commands/npm-restart)
69 