NPM-RESTART(1)

πŸ’… npm-restart

okay bestie, welcome to npm-restart β€” that's the npm-restart(1) manual page, section 1 of the npm docs, and honestly? it's giving "small but mighty." let's get into it πŸŽ€


✨ NAME ✨

npm-restart β€” no cap, this one just restarts a package. that's the whole vibe. πŸ¦‹


🌸 Synopsis 🌸

npm restart [-- <args>]

literally that's it. you pass -- <args> if you've got extra args to hand off, iykyk. πŸ’œ


πŸ”₯ Description πŸ”₯

so here's the tea: this command restarts a project. it's equivalent to running npm run restart. periodt. πŸ’…

now, this is where it gets cute, because npm is lowkey smart about which scripts it fires off. two scenarios, bestie:

scenario one β€” your package.json HAS a "restart" script. iconic. then these get run, in this exact order:

  1. prerestart
  2. restart
  3. postrestart

scenario two β€” no "restart" script, BUT you've got stop and/or start scripts. also valid! then npm runs a whole lil lineup for you:

  1. prerestart
  2. prestop
  3. stop
  4. poststop
  5. prestart
  6. start
  7. poststart
  8. postrestart

like… it really said "i'll handle the whole lifecycle for you." main character energy fr fr. πŸ‘‘βœ¨


🧚 Configuration 🧚

⭐ ignore-scripts

  • Default: false
  • Type: Boolean

if true, npm does not run scripts specified in package.json files. that's the whole deal. πŸ™ˆ

but wait β€” important caveat bestie, don't miss this: commands that are explicitly intended to run a particular script, like npm start, npm stop, npm restart, npm test, and npm run, will still run their intended script if ignore-scripts is set β€” they just won't run any pre- or post-scripts. so the main event happens, the openers and the encore don't. 🎀

also, setting ignore-scripts disables .npm-extension execution too, exactly as if ignore-extension were set. two-for-one situation. πŸ’€

🐚 script-shell

  • Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
  • Type: null or String

this is the shell used for scripts run with the npm exec, npm run and npm init <package-spec> commands. pick your fighter. 🌈


🫢 See Also 🫢

  • npm help run
  • npm help scripts
  • npm help test
  • npm help start
  • npm help stop
  • npm help restart

(yeah, npm help restart is in there. self-referential queen. πŸ‘‘)


and that's the page!! πŸ“ this was NPM@12.2.1, dated October 2026 β€” mwah, love that for us. now go restart something, bestie, you've got this πŸ’–βœ¨πŸ§š

πŸ“¦ where this page comes from