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
|
2022-02-24 21:41:49 +00:00
|
|
|
npm edit <pkg>[/<subpkg>...]
|
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
|
|
|
|
2021-05-20 15:54:50 -04:00
|
|
|
#### `editor`
|
2011-11-21 09:48:45 -08:00
|
|
|
|
2022-12-06 22:18:33 -05:00
|
|
|
* Default: The EDITOR or VISUAL environment variables, or
|
|
|
|
'%SYSTEMROOT%\notepad.exe' on Windows, or 'vi' on Unix systems
|
2021-05-20 15:54:50 -04:00
|
|
|
* Type: String
|
2011-11-21 09:48:45 -08:00
|
|
|
|
2021-05-20 15:54:50 -04:00
|
|
|
The command to run for `npm edit` and `npm config edit`.
|
|
|
|
|
2023-06-08 05:24:49 -07:00
|
|
|
|
|
|
|
|
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)
|