npm-start.1 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. .TH "NPM\-START" "1" "October 2021" "" ""
  2. .SH "NAME"
  3. \fBnpm-start\fR \- Start a package
  4. .SS Synopsis
  5. .P
  6. .RS 2
  7. .nf
  8. npm start [\-\- <args>]
  9. .fi
  10. .RE
  11. .SS Description
  12. .P
  13. This runs a predefined command specified in the \fB"start"\fP property of
  14. a package's \fB"scripts"\fP object\.
  15. .P
  16. If the \fB"scripts"\fP object does not define a \fB"start"\fP property, npm
  17. will run \fBnode server\.js\fP\|\.
  18. .P
  19. Note that this is different from the default node behavior of running
  20. the file specified in a package's \fB"main"\fP attribute when evoking with
  21. \fBnode \.\fP
  22. .P
  23. As of \fBnpm@2\.0\.0\fP \fIhttps://blog\.npmjs\.org/post/98131109725/npm\-2\-0\-0\fR, you can
  24. use custom arguments when executing scripts\. Refer to npm help \fBrun\-script\fP for more details\.
  25. .SS Example
  26. .P
  27. .RS 2
  28. .nf
  29. {
  30. "scripts": {
  31. "start": "node foo\.js"
  32. }
  33. }
  34. .fi
  35. .RE
  36. .P
  37. .RS 2
  38. .nf
  39. npm start
  40. > npm@x\.x\.x start
  41. > node foo\.js
  42. (foo\.js output would be here)
  43. .fi
  44. .RE
  45. .SS Configuration
  46. <!\-\- AUTOGENERATED CONFIG DESCRIPTIONS START \-\->
  47. <!\-\- automatically generated, do not edit manually \-\->
  48. <!\-\- see lib/utils/config/definitions\.js \-\->
  49. .SS \fBignore\-scripts\fP
  50. .RS 0
  51. .IP \(bu 2
  52. Default: false
  53. .IP \(bu 2
  54. Type: Boolean
  55. .RE
  56. .P
  57. If true, npm does not run scripts specified in package\.json files\.
  58. .P
  59. Note that commands explicitly intended to run a particular script, such as
  60. \fBnpm start\fP, \fBnpm stop\fP, \fBnpm restart\fP, \fBnpm test\fP, and \fBnpm run\-script\fP
  61. will still run their intended script if \fBignore\-scripts\fP is set, but they
  62. will \fInot\fR run any pre\- or post\-scripts\.
  63. <!\-\- automatically generated, do not edit manually \-\->
  64. <!\-\- see lib/utils/config/definitions\.js \-\->
  65. .SS \fBscript\-shell\fP
  66. .RS 0
  67. .IP \(bu 2
  68. Default: '/bin/sh' on POSIX systems, 'cmd\.exe' on Windows
  69. .IP \(bu 2
  70. Type: null or String
  71. .RE
  72. .P
  73. The shell to use for scripts run with the \fBnpm exec\fP, \fBnpm run\fP and \fBnpm
  74. init <pkg>\fP commands\.
  75. <!\-\- automatically generated, do not edit manually \-\->
  76. <!\-\- see lib/utils/config/definitions\.js \-\->
  77. <!\-\- AUTOGENERATED CONFIG DESCRIPTIONS END \-\->
  78. .SS See Also
  79. .RS 0
  80. .IP \(bu 2
  81. npm help run\-script
  82. .IP \(bu 2
  83. npm help scripts
  84. .IP \(bu 2
  85. npm help test
  86. .IP \(bu 2
  87. npm help restart
  88. .IP \(bu 2
  89. npm help stop
  90. .RE