2019-11-05 14:55:08 -05:00
|
|
|
---
|
|
|
|
title: npm-stop
|
2020-11-01 07:54:36 +01:00
|
|
|
section: 1
|
2019-11-05 14:55:08 -05:00
|
|
|
description: Stop a package
|
|
|
|
---
|
|
|
|
|
|
|
|
### Synopsis
|
|
|
|
|
|
|
|
```bash
|
|
|
|
npm stop [-- <args>]
|
|
|
|
```
|
|
|
|
|
|
|
|
### Description
|
|
|
|
|
2021-01-15 16:09:24 -05:00
|
|
|
This runs a predefined command specified in the "stop" property of a
|
|
|
|
package's "scripts" object.
|
|
|
|
|
|
|
|
Unlike with [npm start](/commands/npm-start), there is no default script
|
|
|
|
that will run if the `"stop"` property is not defined.
|
|
|
|
|
|
|
|
### Example
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"scripts": {
|
|
|
|
"stop": "node bar.js"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
```bash
|
|
|
|
npm stop
|
|
|
|
|
|
|
|
> npm@x.x.x stop
|
|
|
|
> node bar.js
|
|
|
|
|
|
|
|
(bar.js output would be here)
|
|
|
|
|
|
|
|
```
|
2019-11-05 14:55:08 -05:00
|
|
|
|
|
|
|
### See Also
|
|
|
|
|
2020-11-01 07:54:36 +01:00
|
|
|
* [npm run-script](/commands/npm-run-script)
|
2019-11-05 14:55:08 -05:00
|
|
|
* [npm scripts](/using-npm/scripts)
|
2020-11-01 07:54:36 +01:00
|
|
|
* [npm test](/commands/npm-test)
|
|
|
|
* [npm start](/commands/npm-start)
|
|
|
|
* [npm restart](/commands/npm-restart)
|