diff --git a/deps/npm/docs/content/commands/npm-ls.md b/deps/npm/docs/content/commands/npm-ls.md index 791e5f88b082bb..b6c1750d7c1bfe 100644 --- a/deps/npm/docs/content/commands/npm-ls.md +++ b/deps/npm/docs/content/commands/npm-ls.md @@ -27,7 +27,7 @@ packages will *also* show the paths to the specified packages. For example, running `npm ls promzard` in npm's source tree will show: ```bash -npm@10.2.0 /path/to/npm +npm@10.2.1 /path/to/npm └─┬ init-package-json@0.0.4 └── promzard@0.1.5 ``` diff --git a/deps/npm/docs/content/commands/npm-rebuild.md b/deps/npm/docs/content/commands/npm-rebuild.md index c42e09767ef4b4..596ae97df24448 100644 --- a/deps/npm/docs/content/commands/npm-rebuild.md +++ b/deps/npm/docs/content/commands/npm-rebuild.md @@ -14,14 +14,29 @@ alias: rb ### Description -This command runs the `npm build` command on the matched folders. This is -useful when you install a new version of node, and must recompile all your -C++ addons with the new binary. It is also useful when installing with -`--ignore-scripts` and `--no-bin-links`, to explicitly choose which -packages to build and/or link bins. - -If one or more package specs are provided, then only packages with a -name and version matching one of the specifiers will be rebuilt. +This command does the following: + +1. Execute lifecycle scripts (`preinstall`, `install`, `postinstall`, `prepare`) +2. Links bins depending on whether bin links are enabled + +This command is particularly useful in scenarios including but not limited to: + +1. Installing a new version of **node.js**, where you need to recompile all your C++ add-ons with the updated binary. +2. Installing with `--ignore-scripts` and `--no-bin-links`, to explicitly choose which packages to build and/or link bins. + +If one or more package specs are provided, then only packages with a name and version matching one of the specifiers will be rebuilt. + +Usually, you should not need to run `npm rebuild` as it is already done for you as part of npm install (unless you suppressed these steps with `--ignore-scripts` or `--no-bin-links`). + +If there is a `binding.gyp` file in the root of your package, then npm will use a default install hook: + +``` +"scripts": { + "install": "node-gyp rebuild" +} +``` + +This default behavior is suppressed if the `package.json` has its own `install` or `preinstall` scripts. It is also suppressed if the package specifies `"gypfile": false` ### Configuration diff --git a/deps/npm/docs/content/commands/npm.md b/deps/npm/docs/content/commands/npm.md index 0a5b88d7083c8a..4f6f7ef55d7364 100644 --- a/deps/npm/docs/content/commands/npm.md +++ b/deps/npm/docs/content/commands/npm.md @@ -14,7 +14,7 @@ Note: This command is unaware of workspaces. ### Version -10.2.0 +10.2.1 ### Description diff --git a/deps/npm/docs/content/using-npm/scripts.md b/deps/npm/docs/content/using-npm/scripts.md index bf212c5db24f77..b25815a428cd4c 100644 --- a/deps/npm/docs/content/using-npm/scripts.md +++ b/deps/npm/docs/content/using-npm/scripts.md @@ -159,8 +159,6 @@ These are run from the scripts of `` * `publish` * `postpublish` -`prepare` will not run during `--dry-run` - #### [`npm rebuild`](/commands/npm-rebuild) * `preinstall` diff --git a/deps/npm/docs/output/commands/npm-ls.html b/deps/npm/docs/output/commands/npm-ls.html index fda40e2beabf14..8f881c8d41a9ad 100644 --- a/deps/npm/docs/output/commands/npm-ls.html +++ b/deps/npm/docs/output/commands/npm-ls.html @@ -160,7 +160,7 @@

Description

the results to only the paths to the packages named. Note that nested packages will also show the paths to the specified packages. For example, running npm ls promzard in npm's source tree will show:

-
npm@10.2.0 /path/to/npm
+
npm@10.2.1 /path/to/npm
 └─┬ init-package-json@0.0.4
   └── promzard@0.1.5
 
diff --git a/deps/npm/docs/output/commands/npm-rebuild.html b/deps/npm/docs/output/commands/npm-rebuild.html index 4d2ce115e6a362..3a1a5a401a6a06 100644 --- a/deps/npm/docs/output/commands/npm-rebuild.html +++ b/deps/npm/docs/output/commands/npm-rebuild.html @@ -151,13 +151,24 @@

Table of contents

alias: rb

Description

-

This command runs the npm build command on the matched folders. This is -useful when you install a new version of node, and must recompile all your -C++ addons with the new binary. It is also useful when installing with ---ignore-scripts and --no-bin-links, to explicitly choose which -packages to build and/or link bins.

-

If one or more package specs are provided, then only packages with a -name and version matching one of the specifiers will be rebuilt.

+

This command does the following:

+
    +
  1. Execute lifecycle scripts (preinstall, install, postinstall, prepare)
  2. +
  3. Links bins depending on whether bin links are enabled
  4. +
+

This command is particularly useful in scenarios including but not limited to:

+
    +
  1. Installing a new version of node.js, where you need to recompile all your C++ add-ons with the updated binary.
  2. +
  3. Installing with --ignore-scripts and --no-bin-links, to explicitly choose which packages to build and/or link bins.
  4. +
+

If one or more package specs are provided, then only packages with a name and version matching one of the specifiers will be rebuilt.

+

Usually, you should not need to run npm rebuild as it is already done for you as part of npm install (unless you suppressed these steps with --ignore-scripts or --no-bin-links).

+

If there is a binding.gyp file in the root of your package, then npm will use a default install hook:

+
"scripts": {
+    "install": "node-gyp rebuild"
+}
+
+

This default behavior is suppressed if the package.json has its own install or preinstall scripts. It is also suppressed if the package specifies "gypfile": false

Configuration

global

-

prepare will not run during --dry-run

npm rebuild