codekingpro/portable-devtools
114k
1---
2title: npm-stop
3section: 1
4description: Stop a package
5---
6
7### Synopsis
8
9```bash
10npm stop [-- <args>]
11```
12
13### Description
14
15This runs a predefined command specified in the "stop" property of a package's "scripts" object.
16
17Unlike with [npm start](/commands/npm-start), there is no default script that will run if the `"stop"` property is not defined.
18
19### Example
20
21```json
22{
23 "scripts": {
24 "stop": "node bar.js"
25 }
26}
27```
28
29```bash
30npm stop
31
32> npm@x.x.x stop
33> node bar.js
34
35(bar.js output would be here)
36
37```
38
39### Configuration
40
41#### `ignore-scripts`
42
43* Default: false
44* Type: Boolean
45
46If true, npm does not run scripts specified in package.json files.
47
48Note that commands explicitly intended to run a particular script, such as
49`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still
50run their intended script if `ignore-scripts` is set, but they will *not*
51run any pre- or post-scripts.
52
53
54
55#### `script-shell`
56
57* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
58* Type: null or String
59
60The shell to use for scripts run with the `npm exec`, `npm run` and `npm
61init <package-spec>` commands.
62
63
64
65### See Also
66
67* [npm run](/commands/npm-run)
68* [npm scripts](/using-npm/scripts)
69* [npm test](/commands/npm-test)
70* [npm start](/commands/npm-start)
71* [npm restart](/commands/npm-restart)
72 