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:
prerestartrestartpostrestart
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:
prerestartprestopstoppoststopprestartstartpoststartpostrestart
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, likenpm start,npm stop,npm restart,npm test, andnpm run, will still run their intended script ifignore-scriptsis 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 runnpm help scriptsnpm help testnpm help startnpm help stopnpm 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
- arch rolling: npm 12.2.1-1 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms