2019-11-05 14:55:08 -05:00
|
|
|
---
|
|
|
|
title: npm-edit
|
2020-11-01 07:54:36 +01:00
|
|
|
section: 1
|
2019-11-05 14:55:08 -05:00
|
|
|
description: Edit an installed package
|
|
|
|
---
|
2011-11-21 09:48:45 -08:00
|
|
|
|
2019-11-05 14:55:08 -05:00
|
|
|
### Synopsis
|
|
|
|
|
|
|
|
```bash
|
2020-11-01 07:54:36 +01:00
|
|
|
npm edit <pkg>
|
2019-11-05 14:55:08 -05:00
|
|
|
```
|
|
|
|
|
2021-03-23 14:58:11 -04:00
|
|
|
Note: This command is unaware of workspaces.
|
|
|
|
|
2019-11-05 14:55:08 -05:00
|
|
|
### Description
|
2011-11-21 09:48:45 -08:00
|
|
|
|
2020-11-01 07:54:36 +01:00
|
|
|
Selects a dependency in the current project and opens the package folder in
|
|
|
|
the default editor (or whatever you've configured as the npm `editor`
|
|
|
|
config -- see [`npm-config`](npm-config).)
|
2011-11-21 09:48:45 -08:00
|
|
|
|
|
|
|
After it has been edited, the package is rebuilt so as to pick up any
|
|
|
|
changes in compiled packages.
|
|
|
|
|
|
|
|
For instance, you can do `npm install connect` to install connect
|
|
|
|
into your package, and then `npm edit connect` to make a few
|
|
|
|
changes to your locally installed copy.
|
|
|
|
|
2019-11-05 14:55:08 -05:00
|
|
|
### Configuration
|
2011-11-21 09:48:45 -08:00
|
|
|
|
2019-11-05 14:55:08 -05:00
|
|
|
#### editor
|
2011-11-21 09:48:45 -08:00
|
|
|
|
|
|
|
* Default: `EDITOR` environment variable if set, or `"vi"` on Posix,
|
|
|
|
or `"notepad"` on Windows.
|
|
|
|
* Type: path
|
|
|
|
|
|
|
|
The command to run for `npm edit` or `npm config edit`.
|
|
|
|
|
2019-11-05 14:55:08 -05:00
|
|
|
### See Also
|
2011-11-21 09:48:45 -08:00
|
|
|
|
2019-11-05 14:55:08 -05:00
|
|
|
* [npm folders](/configuring-npm/folders)
|
2020-11-01 07:54:36 +01:00
|
|
|
* [npm explore](/commands/npm-explore)
|
|
|
|
* [npm install](/commands/npm-install)
|
|
|
|
* [npm config](/commands/npm-config)
|
2019-11-05 14:55:08 -05:00
|
|
|
* [npmrc](/configuring-npm/npmrc)
|