npm-restart.1 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. .TH "NPM-RESTART" "1" "March 2026" "NPM@11.12.0" ""
  2. .SH "NAME"
  3. \fBnpm-restart\fR - Restart a package
  4. .SS "Synopsis"
  5. .P
  6. .RS 2
  7. .nf
  8. npm restart \[lB]-- <args>\[rB]
  9. .fi
  10. .RE
  11. .SS "Description"
  12. .P
  13. This restarts a project. It is equivalent to running \fBnpm run restart\fR.
  14. .P
  15. If the current project has a \fB"restart"\fR script specified in \fBpackage.json\fR, then the following scripts will be run:
  16. .RS 0
  17. .IP 1. 4
  18. prerestart
  19. .IP 2. 4
  20. restart
  21. .IP 3. 4
  22. postrestart
  23. .RE 0
  24. .P
  25. If it does \fInot\fR have a \fB"restart"\fR script specified, but it does have \fBstop\fR and/or \fBstart\fR scripts, then the following scripts will be run:
  26. .RS 0
  27. .IP 1. 4
  28. prerestart
  29. .IP 2. 4
  30. prestop
  31. .IP 3. 4
  32. stop
  33. .IP 4. 4
  34. poststop
  35. .IP 5. 4
  36. prestart
  37. .IP 6. 4
  38. start
  39. .IP 7. 4
  40. poststart
  41. .IP 8. 4
  42. postrestart
  43. .RE 0
  44. .SS "Configuration"
  45. .SS "\fBignore-scripts\fR"
  46. .RS 0
  47. .IP \(bu 4
  48. Default: false
  49. .IP \(bu 4
  50. Type: Boolean
  51. .RE 0
  52. .P
  53. If true, npm does not run scripts specified in package.json files.
  54. .P
  55. Note that commands explicitly intended to run a particular script, such as \fBnpm start\fR, \fBnpm stop\fR, \fBnpm restart\fR, \fBnpm test\fR, and \fBnpm run\fR will still run their intended script if \fBignore-scripts\fR is set, but they will \fInot\fR run any pre- or post-scripts.
  56. .SS "\fBscript-shell\fR"
  57. .RS 0
  58. .IP \(bu 4
  59. Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
  60. .IP \(bu 4
  61. Type: null or String
  62. .RE 0
  63. .P
  64. The shell to use for scripts run with the \fBnpm exec\fR, \fBnpm run\fR and \fBnpm
  65. init <package-spec>\fR commands.
  66. .SS "See Also"
  67. .RS 0
  68. .IP \(bu 4
  69. npm help run
  70. .IP \(bu 4
  71. npm help scripts
  72. .IP \(bu 4
  73. npm help test
  74. .IP \(bu 4
  75. npm help start
  76. .IP \(bu 4
  77. npm help stop
  78. .IP \(bu 4
  79. npm help restart
  80. .RE 0