2021-05-10 17:31:02 -04:00
|
|
|
.TH "NPM\-START" "1" "May 2021" "" ""
|
2011-11-26 09:21:03 -08:00
|
|
|
.SH "NAME"
|
2019-11-18 21:01:39 +02:00
|
|
|
\fBnpm-start\fR \- Start a package
|
2019-11-05 14:55:08 -05:00
|
|
|
.SS Synopsis
|
2014-09-24 14:41:07 -07:00
|
|
|
.P
|
|
|
|
.RS 2
|
2014-11-04 15:08:12 -08:00
|
|
|
.nf
|
2014-09-24 14:41:07 -07:00
|
|
|
npm start [\-\- <args>]
|
2014-11-04 15:08:12 -08:00
|
|
|
.fi
|
2014-09-24 14:41:07 -07:00
|
|
|
.RE
|
2019-11-05 14:55:08 -05:00
|
|
|
.SS Description
|
2014-09-24 14:41:07 -07:00
|
|
|
.P
|
2021-01-15 16:09:24 -05:00
|
|
|
This runs a predefined command specified in the \fB"start"\fP property of
|
|
|
|
a package's \fB"scripts"\fP object\.
|
|
|
|
.P
|
|
|
|
If the \fB"scripts"\fP object does not define a \fB"start"\fP property, npm
|
|
|
|
will run \fBnode server\.js\fP\|\.
|
|
|
|
.P
|
|
|
|
Note that this is different from the default node behavior of running
|
|
|
|
the file specified in a package's \fB"main"\fP attribute when evoking with
|
|
|
|
\fBnode \.\fP
|
2016-01-28 18:11:35 -08:00
|
|
|
.P
|
2019-07-24 23:00:03 -07:00
|
|
|
As of \fBnpm@2\.0\.0\fP \fIhttps://blog\.npmjs\.org/post/98131109725/npm\-2\-0\-0\fR, you can
|
2019-11-18 21:01:39 +02:00
|
|
|
use custom arguments when executing scripts\. Refer to npm help \fBrun\-script\fP for more details\.
|
2021-01-15 16:09:24 -05:00
|
|
|
.SS Example
|
|
|
|
.P
|
|
|
|
.RS 2
|
|
|
|
.nf
|
|
|
|
{
|
|
|
|
"scripts": {
|
|
|
|
"start": "node foo\.js"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.fi
|
|
|
|
.RE
|
|
|
|
.P
|
|
|
|
.RS 2
|
|
|
|
.nf
|
|
|
|
npm start
|
|
|
|
|
|
|
|
> npm@x\.x\.x start
|
|
|
|
> node foo\.js
|
|
|
|
|
|
|
|
(foo\.js output would be here)
|
|
|
|
|
|
|
|
.fi
|
|
|
|
.RE
|
2019-11-05 14:55:08 -05:00
|
|
|
.SS See Also
|
2014-09-24 14:41:07 -07:00
|
|
|
.RS 0
|
|
|
|
.IP \(bu 2
|
2019-11-18 21:01:39 +02:00
|
|
|
npm help run\-script
|
2014-09-24 14:41:07 -07:00
|
|
|
.IP \(bu 2
|
2019-11-05 14:55:08 -05:00
|
|
|
npm help scripts
|
2014-09-24 14:41:07 -07:00
|
|
|
.IP \(bu 2
|
2019-11-18 21:01:39 +02:00
|
|
|
npm help test
|
2014-09-24 14:41:07 -07:00
|
|
|
.IP \(bu 2
|
2019-11-18 21:01:39 +02:00
|
|
|
npm help restart
|
2014-09-24 14:41:07 -07:00
|
|
|
.IP \(bu 2
|
2019-11-18 21:01:39 +02:00
|
|
|
npm help stop
|
2014-09-24 14:41:07 -07:00
|
|
|
|
|
|
|
.RE
|