2014-03-04 12:43:17 +11:00
|
|
|
# npm
|
|
|
|
|
2016-01-30 15:04:30 +02:00
|
|
|
> JavaScript and Node.js package manager.
|
|
|
|
> Manage Node.js projects and their module dependencies.
|
2022-02-02 15:43:21 -03:00
|
|
|
> More information: <https://www.npmjs.com>.
|
2014-03-04 12:43:17 +11:00
|
|
|
|
2024-10-20 00:02:10 +02:00
|
|
|
- Create a `package.json` file with default values (omit `--yes` to do it interactively):
|
2015-12-29 22:46:40 -06:00
|
|
|
|
2024-09-08 18:52:28 +03:00
|
|
|
`npm init {{-y|--yes}}`
|
2015-12-29 22:46:40 -06:00
|
|
|
|
pages.es/*: add Spanish translation; npm: update page (#11297)
* npm: improved description of npm list and npm install
* npm, nvm: add Spanish translation
* nvm: add Spanish translations to the commands
* helm-install, helm, nest, netlify, next, nginx, vite: add Spanish translation
* choco, clear, cmd, del, dir, mkdir: add Spanish translation
* helm-*: update Spanish translation
Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
* pages.es/common: update pages
Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
* pages.es/windows: update pages
Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
---------
Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
Co-authored-by: Darío Hereñú <magallania@gmail.com>
2023-10-27 13:43:16 -05:00
|
|
|
- Download all the packages listed as dependencies in `package.json`:
|
2016-01-30 18:15:22 +02:00
|
|
|
|
|
|
|
`npm install`
|
|
|
|
|
2021-01-31 14:05:18 -03:00
|
|
|
- Download a specific version of a package and add it to the list of dependencies in `package.json`:
|
2019-03-07 12:07:40 -08:00
|
|
|
|
2023-10-11 09:33:22 +02:00
|
|
|
`npm install {{package_name}}@{{version}}`
|
2019-03-07 12:07:40 -08:00
|
|
|
|
2023-10-11 09:32:21 +02:00
|
|
|
- Download the latest version of a package and add it to the list of dev dependencies in `package.json`:
|
2014-03-04 12:43:17 +11:00
|
|
|
|
2024-09-08 18:52:28 +03:00
|
|
|
`npm install {{package_name}} {{-D|--save-dev}}`
|
2014-03-04 12:43:17 +11:00
|
|
|
|
2023-10-11 09:32:21 +02:00
|
|
|
- Download the latest version of a package and install it globally:
|
2016-05-04 10:46:42 +02:00
|
|
|
|
2024-09-17 09:59:41 +02:00
|
|
|
`npm install {{-g|--global}} {{package_name}}`
|
2016-05-04 10:46:42 +02:00
|
|
|
|
2021-01-31 14:05:18 -03:00
|
|
|
- Uninstall a package and remove it from the list of dependencies in `package.json`:
|
2014-03-04 12:43:17 +11:00
|
|
|
|
2023-10-11 09:33:22 +02:00
|
|
|
`npm uninstall {{package_name}}`
|
2014-03-04 12:43:17 +11:00
|
|
|
|
pages.es/*: add Spanish translation; npm: update page (#11297)
* npm: improved description of npm list and npm install
* npm, nvm: add Spanish translation
* nvm: add Spanish translations to the commands
* helm-install, helm, nest, netlify, next, nginx, vite: add Spanish translation
* choco, clear, cmd, del, dir, mkdir: add Spanish translation
* helm-*: update Spanish translation
Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
* pages.es/common: update pages
Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
* pages.es/windows: update pages
Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
---------
Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
Co-authored-by: Darío Hereñú <magallania@gmail.com>
2023-10-27 13:43:16 -05:00
|
|
|
- List of locally installed dependencies:
|
2014-03-04 12:43:17 +11:00
|
|
|
|
2016-01-30 15:04:30 +02:00
|
|
|
`npm list`
|
2015-12-30 14:10:04 +01:00
|
|
|
|
2023-10-11 09:33:22 +02:00
|
|
|
- List top-level globally installed packages:
|
2017-11-22 15:56:00 -08:00
|
|
|
|
2024-09-08 18:52:28 +03:00
|
|
|
`npm list {{-g|--global}} --depth {{0}}`
|