11cb0ef41Sopenharmony_ci---
21cb0ef41Sopenharmony_cititle: npm-restart
31cb0ef41Sopenharmony_cisection: 1
41cb0ef41Sopenharmony_cidescription: Restart a package
51cb0ef41Sopenharmony_ci---
61cb0ef41Sopenharmony_ci
71cb0ef41Sopenharmony_ci### Synopsis
81cb0ef41Sopenharmony_ci
91cb0ef41Sopenharmony_ci```bash
101cb0ef41Sopenharmony_cinpm restart [-- <args>]
111cb0ef41Sopenharmony_ci```
121cb0ef41Sopenharmony_ci
131cb0ef41Sopenharmony_ci### Description
141cb0ef41Sopenharmony_ci
151cb0ef41Sopenharmony_ciThis restarts a project.  It is equivalent to running `npm run-script
161cb0ef41Sopenharmony_cirestart`.
171cb0ef41Sopenharmony_ci
181cb0ef41Sopenharmony_ciIf the current project has a `"restart"` script specified in
191cb0ef41Sopenharmony_ci`package.json`, then the following scripts will be run:
201cb0ef41Sopenharmony_ci
211cb0ef41Sopenharmony_ci1. prerestart
221cb0ef41Sopenharmony_ci2. restart
231cb0ef41Sopenharmony_ci3. postrestart
241cb0ef41Sopenharmony_ci
251cb0ef41Sopenharmony_ciIf it does _not_ have a `"restart"` script specified, but it does have
261cb0ef41Sopenharmony_ci`stop` and/or `start` scripts, then the following scripts will be run:
271cb0ef41Sopenharmony_ci
281cb0ef41Sopenharmony_ci1. prerestart
291cb0ef41Sopenharmony_ci2. prestop
301cb0ef41Sopenharmony_ci3. stop
311cb0ef41Sopenharmony_ci4. poststop
321cb0ef41Sopenharmony_ci6. prestart
331cb0ef41Sopenharmony_ci7. start
341cb0ef41Sopenharmony_ci8. poststart
351cb0ef41Sopenharmony_ci9. postrestart
361cb0ef41Sopenharmony_ci
371cb0ef41Sopenharmony_ci### Configuration
381cb0ef41Sopenharmony_ci
391cb0ef41Sopenharmony_ci#### `ignore-scripts`
401cb0ef41Sopenharmony_ci
411cb0ef41Sopenharmony_ci* Default: false
421cb0ef41Sopenharmony_ci* Type: Boolean
431cb0ef41Sopenharmony_ci
441cb0ef41Sopenharmony_ciIf true, npm does not run scripts specified in package.json files.
451cb0ef41Sopenharmony_ci
461cb0ef41Sopenharmony_ciNote that commands explicitly intended to run a particular script, such as
471cb0ef41Sopenharmony_ci`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
481cb0ef41Sopenharmony_ciwill still run their intended script if `ignore-scripts` is set, but they
491cb0ef41Sopenharmony_ciwill *not* run any pre- or post-scripts.
501cb0ef41Sopenharmony_ci
511cb0ef41Sopenharmony_ci
521cb0ef41Sopenharmony_ci
531cb0ef41Sopenharmony_ci#### `script-shell`
541cb0ef41Sopenharmony_ci
551cb0ef41Sopenharmony_ci* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
561cb0ef41Sopenharmony_ci* Type: null or String
571cb0ef41Sopenharmony_ci
581cb0ef41Sopenharmony_ciThe shell to use for scripts run with the `npm exec`, `npm run` and `npm
591cb0ef41Sopenharmony_ciinit <package-spec>` commands.
601cb0ef41Sopenharmony_ci
611cb0ef41Sopenharmony_ci
621cb0ef41Sopenharmony_ci
631cb0ef41Sopenharmony_ci### See Also
641cb0ef41Sopenharmony_ci
651cb0ef41Sopenharmony_ci* [npm run-script](/commands/npm-run-script)
661cb0ef41Sopenharmony_ci* [npm scripts](/using-npm/scripts)
671cb0ef41Sopenharmony_ci* [npm test](/commands/npm-test)
681cb0ef41Sopenharmony_ci* [npm start](/commands/npm-start)
691cb0ef41Sopenharmony_ci* [npm stop](/commands/npm-stop)
701cb0ef41Sopenharmony_ci* [npm restart](/commands/npm-restart)
71