1 ---
2 title: npm-edit
3 section: 1
4 description: Edit an installed package
5 github_repo: npm/cli
6 github_branch: release/v6
7 github_path: docs/content/commands/npm-edit.md
8 redirect_from:
9 - /cli-documentation/v6/cli-commands/edit
10 - /cli-documentation/v6/cli-commands/npm-edit
11 - /cli-documentation/v6/commands/edit
12 - /cli-documentation/v6/commands/npm-edit
13 - /cli-documentation/v6/edit
14 - /cli-documentation/v6/npm-edit
15 - /cli/v6/cli-commands/edit
16 - /cli/v6/cli-commands/npm-edit
17 - /cli/v6/commands/edit
18 - /cli/v6/edit
19 - /cli/v6/npm-edit
20 ---
21
22 ### Synopsis
23
24 ```bash
25 npm edit <pkg>[/<subpkg>...]
26 ```
27
28 ### Description
29
30 Selects a (sub)dependency in the current working directory and opens the package folder in the default editor (or whatever you've configured as the npm `editor` config -- see [`npm-config`](npm-config).)
31
32 After it has been edited, the package is rebuilt so as to pick up any changes in compiled packages.
33
34 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.
35
36 ### Configuration
37
38 #### editor
39
40 - Default: `EDITOR` environment variable if set, or `"vi"` on Posix, or `"notepad"` on Windows.
41 - Type: path
42
43 The command to run for `npm edit` or `npm config edit`.
44
45 ### See Also
46
47 - [npm folders](/cli/v6/configuring-npm/folders)
48 - [npm explore](/cli/v6/commands/npm-explore)
49 - [npm install](/cli/v6/commands/npm-install)
50 - [npm config](/cli/v6/commands/npm-config)
51 - [npmrc](/cli/v6/configuring-npm/npmrc)