dependabot/npm_and_yarn/main/eslint-10.4.0
@reggi/path-to-regexp
dependabot/npm_and_yarn/main/copy-to-clipboard-4.0.2
dependabot/npm_and_yarn/main/eslint-10.4.0
dependabot/npm_and_yarn/main/npmcli/eslint-config-7.0.0
dependabot/npm_and_yarn/main/proc-log-7.0.0
dependabot/npm_and_yarn/npm_and_yarn-826852524d
dependabot/npm_and_yarn/npm_and_yarn-ab9a7f4bc2
deprecate-totp-2fa
dhei/classic-tokens
gat-bypass-2fa-docs
jpg619/fix-accessibility-content-flow
jpg619/version-bump-tar-2
kartykp/gat-bypass-2fa-docs
kartykp/upgrade-path-to-regex
main
maitxn/version-bump-tar
patch-1
reggi/cache-based-on-version
reggi/dev-engines
reggi/fix-transform-prettier
reggi/overrides
update-search-sensitivity
| 1 | --- |
| 2 | title: npm-start |
| 3 | section: 1 |
| 4 | description: Start a package |
| 5 | github_repo: npm/cli |
| 6 | github_branch: release/v9 |
| 7 | github_path: docs/lib/content/commands/npm-start.md |
| 8 | redirect_from: |
| 9 | - /cli-documentation/v9/cli-commands/npm-start |
| 10 | - /cli-documentation/v9/cli-commands/start |
| 11 | - /cli-documentation/v9/commands/npm-start |
| 12 | - /cli-documentation/v9/commands/start |
| 13 | - /cli-documentation/v9/npm-start |
| 14 | - /cli-documentation/v9/start |
| 15 | - /cli/v9/cli-commands/npm-start |
| 16 | - /cli/v9/cli-commands/start |
| 17 | - /cli/v9/commands/start |
| 18 | - /cli/v9/npm-start |
| 19 | - /cli/v9/start |
| 20 | --- |
| 21 | |
| 22 | ### Synopsis |
| 23 | |
| 24 | ```bash |
| 25 | npm start [-- <args>] |
| 26 | ``` |
| 27 | |
| 28 | ### Description |
| 29 | |
| 30 | This runs a predefined command specified in the `"start"` property of a package's `"scripts"` object. |
| 31 | |
| 32 | If the `"scripts"` object does not define a `"start"` property, npm will run `node server.js`. |
| 33 | |
| 34 | Note that this is different from the default node behavior of running the file specified in a package's `"main"` attribute when evoking with `node .` |
| 35 | |
| 36 | As of [`npm@2.0.0`](https://blog.npmjs.org/post/98131109725/npm-2-0-0), you can use custom arguments when executing scripts. Refer to [`npm run-script`](/cli/v9/commands/npm-run-script) for more details. |
| 37 | |
| 38 | ### Example |
| 39 | |
| 40 | ```json |
| 41 | { |
| 42 | "scripts": { |
| 43 | "start": "node foo.js" |
| 44 | } |
| 45 | } |
| 46 | ``` |
| 47 | |
| 48 | ```bash |
| 49 | npm start |
| 50 | |
| 51 | > npm@x.x.x start |
| 52 | > node foo.js |
| 53 | |
| 54 | (foo.js output would be here) |
| 55 | |
| 56 | ``` |
| 57 | |
| 58 | ### Configuration |
| 59 | |
| 60 | #### `ignore-scripts` |
| 61 | |
| 62 | - Default: false |
| 63 | - Type: Boolean |
| 64 | |
| 65 | If true, npm does not run scripts specified in package.json files. |
| 66 | |
| 67 | Note that commands explicitly intended to run a particular script, such as `npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script` will still run their intended script if `ignore-scripts` is set, but they will _not_ run any pre- or post-scripts. |
| 68 | |
| 69 | #### `script-shell` |
| 70 | |
| 71 | - Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows |
| 72 | - Type: null or String |
| 73 | |
| 74 | The shell to use for scripts run with the `npm exec`, `npm run` and `npm init <package-spec>` commands. |
| 75 | |
| 76 | ### See Also |
| 77 | |
| 78 | - [npm run-script](/cli/v9/commands/npm-run-script) |
| 79 | - [npm scripts](/cli/v9/using-npm/scripts) |
| 80 | - [npm test](/cli/v9/commands/npm-test) |
| 81 | - [npm restart](/cli/v9/commands/npm-restart) |
| 82 | - [npm stop](/cli/v9/commands/npm-stop) |