1 ---
2 title: npm-edit
3 section: 1
4 description: Edit an installed package
5 github_repo: npm/cli
6 github_branch: latest
7 github_path: docs/lib/content/commands/npm-edit.md
8 redirect_from:
9 - /cli-commands/edit
10 - /cli-commands/npm-edit
11 - /cli-documentation/cli-commands/edit
12 - /cli-documentation/cli-commands/npm-edit
13 - /cli-documentation/commands/edit
14 - /cli-documentation/commands/npm-edit
15 - /cli-documentation/edit
16 - /cli-documentation/npm-edit
17 - /cli-documentation/v10/cli-commands/edit
18 - /cli-documentation/v10/cli-commands/npm-edit
19 - /cli-documentation/v10/commands/edit
20 - /cli-documentation/v10/commands/npm-edit
21 - /cli-documentation/v10/edit
22 - /cli-documentation/v10/npm-edit
23 - /cli/cli-commands/edit
24 - /cli/cli-commands/npm-edit
25 - /cli/commands/edit
26 - /cli/commands/npm-edit
27 - /cli/edit
28 - /cli/npm-edit
29 - /cli/v10/cli-commands/edit
30 - /cli/v10/cli-commands/npm-edit
31 - /cli/v10/commands/edit
32 - /cli/v10/edit
33 - /cli/v10/npm-edit
34 - /commands/edit
35 - /commands/npm-edit
36 ---
37
38 ### Synopsis
39
40 ```bash
41 npm edit <pkg>[/<subpkg>...]
42 ```
43
44 Note: This command is unaware of workspaces.
45
46 ### Description
47
48 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).)
49
50 After it has been edited, the package is rebuilt so as to pick up any changes in compiled packages.
51
52 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.
53
54 ### Configuration
55
56 #### `editor`
57
58 - Default: The EDITOR or VISUAL environment variables, or '%SYSTEMROOT%\notepad.exe' on Windows, or 'vi' on Unix systems
59 - Type: String
60
61 The command to run for `npm edit` and `npm config edit`.
62
63 ### See Also
64
65 - [npm folders](/cli/v10/configuring-npm/folders)
66 - [npm explore](/cli/v10/commands/npm-explore)
67 - [npm install](/cli/v10/commands/npm-install)
68 - [npm config](/cli/v10/commands/npm-config)
69 - [npmrc](/cli/v10/configuring-npm/npmrc)