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