2025-04-10 14:36:22 -07:00
.TH "NPM-START" "1" "April 2025" "NPM@11.3.0" ""
2011-11-26 09:21:03 -08:00
.SH "NAME"
2022-12-06 22:18:33 -05:00
\fB npm-start\fR - Start a package
.SS "Synopsis"
2014-09-24 14:41:07 -07:00
.P
.RS 2
2014-11-04 15:08:12 -08:00
.nf
2022-12-06 22:18:33 -05:00
npm start \[ lB]-- <args>\[ rB]
2014-11-04 15:08:12 -08:00
.fi
2014-09-24 14:41:07 -07:00
.RE
2022-12-06 22:18:33 -05:00
.SS "Description"
2014-09-24 14:41:07 -07:00
.P
2022-12-06 22:18:33 -05:00
This runs a predefined command specified in the \fB "start"\fR property of a package's \fB "scripts"\fR object.
2021-01-15 16:09:24 -05:00
.P
2022-12-06 22:18:33 -05:00
If the \fB "scripts"\fR object does not define a \fB "start"\fR property, npm will run \fB node server.js\fR .
2021-01-15 16:09:24 -05:00
.P
2022-12-06 22:18:33 -05:00
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 \fB node .\fR
2016-01-28 18:11:35 -08:00
.P
2022-12-06 22:18:33 -05:00
As of \fB \fB npm@2.0.0\fR \fR \fI \(la https://blog.npmjs.org/post/98131109725/npm-2-0-0\(ra \fR , you can use custom arguments when executing scripts. Refer to npm help run-script for more details.
.SS "Example"
2021-01-15 16:09:24 -05:00
.P
.RS 2
.nf
{
"scripts": {
2022-12-06 22:18:33 -05:00
"start": "node foo.js"
2021-01-15 16:09:24 -05:00
}
}
.fi
.RE
.P
.RS 2
.nf
npm start
2022-12-06 22:18:33 -05:00
> npm@x.x.x start
> node foo.js
2021-01-15 16:09:24 -05:00
2022-12-06 22:18:33 -05:00
(foo.js output would be here)
2021-01-15 16:09:24 -05:00
.fi
.RE
2022-12-06 22:18:33 -05:00
.SS "Configuration"
.SS "\fBignore-scripts\fR"
2021-05-20 15:54:50 -04:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2021-05-20 15:54:50 -04:00
Default: false
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2021-05-20 15:54:50 -04:00
Type: Boolean
2022-12-06 22:18:33 -05:00
.RE 0
2021-05-20 15:54:50 -04:00
.P
2022-12-06 22:18:33 -05:00
If true, npm does not run scripts specified in package.json files.
2021-05-20 15:54:50 -04:00
.P
2022-12-06 22:18:33 -05:00
Note that commands explicitly intended to run a particular script, such as \fB npm start\fR , \fB npm stop\fR , \fB npm restart\fR , \fB npm test\fR , and \fB npm run-script\fR will still run their intended script if \fB ignore-scripts\fR is set, but they will \fI not\fR run any pre- or post-scripts.
.SS "\fBscript-shell\fR"
2021-05-20 15:54:50 -04:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
.IP \(bu 4
2021-05-20 15:54:50 -04:00
Type: null or String
2022-12-06 22:18:33 -05:00
.RE 0
2021-05-20 15:54:50 -04:00
.P
2022-12-06 22:18:33 -05:00
The shell to use for scripts run with the \fB npm exec\fR , \fB npm run\fR and \fB npm
init <package-spec>\fR commands.
.SS "See Also"
2014-09-24 14:41:07 -07:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
npm help run-script
.IP \(bu 4
2019-11-05 14:55:08 -05:00
npm help scripts
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2019-11-18 21:01:39 +02:00
npm help test
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2019-11-18 21:01:39 +02:00
npm help restart
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2019-11-18 21:01:39 +02:00
npm help stop
2022-12-06 22:18:33 -05:00
.RE 0