npm start

开始一个包

概要

npm start [-- <args>]

描述

这将运行在包的 "scripts" 对象的 "start" 属性中指定的预定义命令。

如果 "scripts" 对象没有定义 "start" 属性,npm 将运行 node server.js

请注意,这与使用 node . 调用时运行包的 "main" 属性中指定的文件的默认 node 行为不同

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

    b0hrlHHbrsBd1+jTjC8F8DEDNkl6svjnmv4dOv0z3hH9CSwZ9rJxsXivCkhcQ7/BNoqwX9jxZRGdLmdIXwj0cA==

m+/PmmREYyHagR59ZHclWa4sPI9qRpmq5pfX7Tmo8AklkYRJf9ls4S684sAFayEhsuMMdrzt8x/uYifJgL0UEljL8QQ/zJl+SsSUbAzMFvA=

UAp5tzWieNOtJS5GZDgp2NZxnk9iLrHs3axIpGGqY9UksQSkPfLPWgYi5VRSyylR+AZ1kZDIzHGznrELMvASIcCxHwehswe5Iok9+FE/dcfnsRI9mSPL4BXC2rU62JGXUzP6F22Zo4hWlh119IplEGyaaA0kRjZYiM0BEc9CeXbu+bGh4N7RCwudfgbi5e9gVtJfsxIMAcmhRRox2Ck2unTRFAKH//bFqXUuM59J/Fh2sJVtQkVGiekwdWetTpHeZsiFZdcBgoO91IQVwrYW0DKEdow3f912nqfr1oX1WDGjmGefkDCviZ80wFt22puZpNVgVOgR3GgIIcY24RR+h88SaN0Bt1xqhKADdCeoLWb+4dIClPZBCZc8G9OMN5NFvW2s5CnFk4AsHy+mhvQFWLrzx1JT8MmsBJERmvhGezgbi0hH19R0sBOWo6Ent6pp

script-shell

    b0hrlHHbrsBd1+jTjC8F8DFp1KNXrdvvnEWWHOHOwoH682flTGZl305KVqxvXigougHVxCjhaFQjpSHgRexrB2VoiWl815Wv0vKCo9LziHAxrvA15UlFyqvu82r0pNsjQQ6tFc7XdbndqEoXByns1BGR3rPvRrM+oL8CcxYM3Zg=

ouus7TG38fsfRZGs/zxGXrooeSUW31c5aEeLGT778QPIBogDspBNkY5odwYj3QkCpgrtGaFxN4tQCyJI4TtYNO+pDO2XHblqZ8frLa71ZARsZLzttyDOaNtUuhmRqM2bCVIlw3aeECMSfRf33OFDRRjwkR6GF3v/ckjG+98c1DdhMZI5PP4sEqX9oLomHmI0