Commit 7dd0dfc 1 parent eb061ca commit 7dd0dfc Copy full SHA for 7dd0dfc
File tree 1 file changed +29
-3
lines changed
1 file changed +29
-3
lines changed Original file line number Diff line number Diff line change @@ -12,13 +12,39 @@ npm start [-- <args>]
12
12
13
13
### Description
14
14
15
- This runs an arbitrary command specified in the package's ` "start" ` property of
16
- its ` "scripts" ` object. If no ` "start" ` property is specified on the
17
- ` "scripts" ` object, it will run ` node server.js ` .
15
+ This runs a predefined command specified in the ` "start" ` property of
16
+ a package's ` "scripts" ` object.
17
+
18
+ If the ` "scripts" ` object does not define a ` "start" ` property, npm
19
+ will run ` node server.js ` .
20
+
21
+ Note that this is different from the default node behavior of running
22
+ the file specified in a package's ` "main" ` attribute when evoking with
23
+ ` node . `
18
24
19
25
As of [ ` npm@2.0.0 ` ] ( https://blog.npmjs.org/post/98131109725/npm-2-0-0 ) , you can
20
26
use custom arguments when executing scripts. Refer to [ ` npm run-script ` ] ( /commands/npm-run-script ) for more details.
21
27
28
+ ### Example
29
+
30
+ ``` json
31
+ {
32
+ "scripts" : {
33
+ "start" : " node foo.js"
34
+ }
35
+ }
36
+ ```
37
+
38
+ ``` bash
39
+ npm start
40
+
41
+ > npm@x.x.x start
42
+ > node foo.js
43
+
44
+ (foo.js output would be here)
45
+
46
+ ```
47
+
22
48
### See Also
23
49
24
50
* [ npm run-script] ( /commands/npm-run-script )
You can’t perform that action at this time.
0 commit comments