npm-start.1 1.8 KB

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