# npm start
开启脚本
# 概要
npm start [-- <args>]
# 描述
这将运行在包的 "scripts" 对象的 "start" 属性中指定的预定义命令。
如果 "scripts" 对象没有定义 "start" 属性,npm 将运行 node server.js。
注意,这与在使用 node . 调用时运行包的 "main" 属性中指定的文件的默认节点行为不同。
自 npm@2.0.0 版本开始,你可以在执行脚本时使用自定义参数。更多详细信息可以参考 npm-run-script。
# 例子
{
  "scripts": {
    "start": "node foo.js"
  }
}
npm start
> npm@x.x.x start
> node foo.js
(foo.js output would be here)
# 配置
# ignore-scripts
- Default: false
- Type: Boolean
如果为 true, npm 不会运行包中指定的 package.json 文件。
注意
如果设置了 ignore-scripts,那些显式地想要运行特定脚本的命令,比如 npm start、npm stop、npm restart、npm test 和 npm run-script 仍然会运行它们想要运行的脚本,但是它们不会运行任何前脚本或后脚本。
# script-shell
- Default: 在 POSIX 系统上为“/bin/sh”,在 Windows 上为“cmd.exe”
- Type: null | String
用于与 npm exec、npm run 和 npm init <package-spec> 命令一起运行的脚本的 shell。
