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