← 返回命令列表

Linux command

npm-restart 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Restart application

npm restart

说明

npm restart runs the lifecycle hooks prerestart, restart, and postrestart in order. If no restart script is defined in package.json, it falls back to running stop followed by start (so the package's own start and stop scripts execute). This is the conventional way to bounce a long-running Node process described by package.json scripts without rewriting the command in your shell.

FAQ

What is the npm-restart command used for?

npm restart runs the lifecycle hooks prerestart, restart, and postrestart in order. If no restart script is defined in package.json, it falls back to running stop followed by start (so the package's own start and stop scripts execute). This is the conventional way to bounce a long-running Node process described by package.json scripts without rewriting the command in your shell.

How do I run a basic npm-restart example?

Run `npm restart` in a terminal, then adjust file names, paths, flags, or remote targets for your system.