选择命令行版本:
🌐 Synopsis
npm restart [-- <args>]
🌐 Description
这会重新启动一个项目。它相当于运行 npm run-script restart。
🌐 This restarts a project. It is equivalent to running npm run-script restart.
如果当前项目在 package.json 中指定了 "restart" 脚本,则将运行以下脚本:
🌐 If the current project has a "restart" script specified in package.json, then the following scripts will be run:
如果没有指定 "restart" 脚本,但有 stop 和/或 start 脚本,则将执行以下脚本:
🌐 If it does not have a "restart" script specified, but it does have stop and/or start scripts, then the following scripts will be run:
🌐 Configuration
ignore-scripts如果为 true,npm 不会运行 package.json 文件中指定的脚本。
🌐 If true, npm does not run scripts specified in package.json files.
请注意,明确用于运行特定脚本的命令,例如 npm start、npm stop、npm restart、npm test 和 npm run-script,如果设置了 ignore-scripts,仍会运行其指定的脚本,但它们不会运行任何前置或后置脚本。
🌐 Note that commands explicitly intended to run a particular script, such as npm start, npm stop, npm restart, npm test, and npm run-script will still run their intended script if ignore-scripts is set, but they will not run any pre- or post-scripts.
script-shell用于通过 npm exec、npm run 和 npm init <package-spec> 命令运行脚本的 shell。
🌐 The shell to use for scripts run with the npm exec, npm run and npm init <package-spec> commands.
🌐 See Also