Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
npm-start.md77 linesDownload Raw Back to commands
1---
2title: npm-start
3section: 1
4description: Start a package
5---
6
7### Synopsis
8
9```bash
10npm start [-- <args>]
11```
12
13### Description
14
15This runs a predefined command specified in the `"start"` property of a package's `"scripts"` object.
16
17If the `"scripts"` object does not define a  `"start"` property, npm will run `node server.js`.
18
19Note that this is different from the default node behavior of running the file specified in a package's `"main"` attribute when evoking with `node .`
20
21As of [`npm@2.0.0`](https://blog.npmjs.org/post/98131109725/npm-2-0-0), you can use custom arguments when executing scripts.
22Refer to [`npm run`](/commands/npm-run) for more details.
23
24### Example
25
26```json
27{
28  "scripts": {
29    "start": "node foo.js"
30  }
31}
32```
33
34```bash
35npm start
36
37> npm@x.x.x start
38> node foo.js
39
40(foo.js output would be here)
41
42```
43
44### Configuration
45
46#### `ignore-scripts`
47
48* Default: false
49* Type: Boolean
50
51If true, npm does not run scripts specified in package.json files.
52
53Note that commands explicitly intended to run a particular script, such as
54`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still
55run their intended script if `ignore-scripts` is set, but they will *not*
56run any pre- or post-scripts.
57
58
59
60#### `script-shell`
61
62* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
63* Type: null or String
64
65The shell to use for scripts run with the `npm exec`, `npm run` and `npm
66init <package-spec>` commands.
67
68
69
70### See Also
71
72* [npm run](/commands/npm-run)
73* [npm scripts](/using-npm/scripts)
74* [npm test](/commands/npm-test)
75* [npm restart](/commands/npm-restart)
76* [npm stop](/commands/npm-stop)
77 
codekingpro/portable-devtools · Team Ai