| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,6 +25,14 @@ In the current release, this field is advisory: install scripts still run | |||
| 25 | 25 | by default, but installs print a list of packages whose scripts have not | |
| 26 | 26 | been reviewed. A future release will block unreviewed install scripts. | |
| 27 | 27 | ||
| 28 | + This command only works inside a project that has a `package.json`. Running | ||
| 29 | + it with `--global` (`-g`) fails with an `EGLOBAL` error, since global | ||
| 30 | + installs (`npm install -g`) and one-off executions (`npm exec` / `npx`) have | ||
| 31 | + no project `package.json` to write to. To allow install scripts in those | ||
| 32 | + contexts, use the `--allow-scripts` flag at install time (for example | ||
| 33 | + `npm install -g --allow-scripts=canvas,sharp`) or persist the setting with | ||
| 34 | + `npm config set allow-scripts=canvas,sharp --location=user`. | ||
| 35 | + | ||
| 28 | 36 | There are three modes: | |
| 29 | 37 | ||
| 30 | 38 | ```bash | |
@@ -74,9 +82,10 @@ npm approve-scripts --allow-scripts-pending | |||
| 74 | 82 | * Default: false | |
| 75 | 83 | * Type: Boolean | |
| 76 | 84 | ||
| 77 | - When running `npm outdated` and `npm ls`, setting `--all` will show all | ||
| 78 | - outdated or installed packages, rather than only those directly depended | ||
| 79 | - upon by the current project. | ||
| 85 | + Show or act on all packages, not just the ones your project directly depends | ||
| 86 | + on. For `npm outdated` and `npm ls` this lists every outdated or installed | ||
| 87 | + package. For `npm approve-scripts` and `npm deny-scripts` it selects every | ||
| 88 | + package with pending install scripts. | ||
| 80 | 89 | ||
| 81 | 90 | ||
| 82 | 91 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -59,9 +59,10 @@ npm deny-scripts --all | |||
| 59 | 59 | * Default: false | |
| 60 | 60 | * Type: Boolean | |
| 61 | 61 | ||
| 62 | - When running `npm outdated` and `npm ls`, setting `--all` will show all | ||
| 63 | - outdated or installed packages, rather than only those directly depended | ||
| 64 | - upon by the current project. | ||
| 62 | + Show or act on all packages, not just the ones your project directly depends | ||
| 63 | + on. For `npm outdated` and `npm ls` this lists every outdated or installed | ||
| 64 | + package. For `npm approve-scripts` and `npm deny-scripts` it selects every | ||
| 65 | + package with pending install scripts. | ||
| 65 | 66 | ||
| 66 | 67 | ||
| 67 | 68 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -375,6 +375,9 @@ sources, the standard precedence applies (cli > env > project > user > | |||
| 375 | 375 | global), so a higher-priority source can always relax or override a | |
| 376 | 376 | lower-priority one. | |
| 377 | 377 | ||
| 378 | + Packages whose names match `min-release-age-exclude` are exempt from this | ||
| 379 | + filter. | ||
| 380 | + | ||
| 378 | 381 | ||
| 379 | 382 | ||
| 380 | 383 | #### `min-release-age` | |
@@ -394,6 +397,37 @@ your `.npmrc` is preserved when npm internally spawns a sub-process with | |||
| 394 | 397 | apply, `before` wins within a single source and across sources the standard | |
| 395 | 398 | precedence rules apply. | |
| 396 | 399 | ||
| 400 | + Packages whose names match `min-release-age-exclude` are exempt from this | ||
| 401 | + filter. | ||
| 402 | + | ||
| 403 | + This value is not exported to the environment for child processes. | ||
| 404 | + | ||
| 405 | + #### `min-release-age-exclude` | ||
| 406 | + | ||
| 407 | + * Default: | ||
| 408 | + * Type: String (can be set multiple times) | ||
| 409 | + | ||
| 410 | + A list of package names or `minimatch` glob patterns that are exempt from | ||
| 411 | + the `min-release-age` (and `before`) filter. A matching package can always | ||
| 412 | + resolve to its newest version, even when a release-age window is set. | ||
| 413 | + | ||
| 414 | + For example, to apply a release-age window to third-party dependencies while | ||
| 415 | + letting internally maintained packages update immediately: | ||
| 416 | + | ||
| 417 | + ``` | ||
| 418 | + min-release-age=7 | ||
| 419 | + min-release-age-exclude[]=@myorg/* | ||
| 420 | + min-release-age-exclude[]=my-internal-pkg | ||
| 421 | + ``` | ||
| 422 | + | ||
| 423 | + Only the named package is exempt; its own dependencies still follow the | ||
| 424 | + release-age policy unless they also match a pattern. Patterns match against | ||
| 425 | + the package name, so `@myorg/*` matches `@myorg/shared-utils`. | ||
| 426 | + | ||
| 427 | + Excluding a package does not change which registry it is fetched from. You | ||
| 428 | + should own your private scope on the public registry so that nobody else can | ||
| 429 | + publish a package with the same name. | ||
| 430 | + | ||
| 397 | 431 | This value is not exported to the environment for child processes. | |
| 398 | 432 | ||
| 399 | 433 | #### `bin-links` | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -717,6 +717,9 @@ sources, the standard precedence applies (cli > env > project > user > | |||
| 717 | 717 | global), so a higher-priority source can always relax or override a | |
| 718 | 718 | lower-priority one. | |
| 719 | 719 | ||
| 720 | + Packages whose names match `min-release-age-exclude` are exempt from this | ||
| 721 | + filter. | ||
| 722 | + | ||
| 720 | 723 | ||
| 721 | 724 | ||
| 722 | 725 | #### `min-release-age` | |
@@ -736,6 +739,37 @@ your `.npmrc` is preserved when npm internally spawns a sub-process with | |||
| 736 | 739 | apply, `before` wins within a single source and across sources the standard | |
| 737 | 740 | precedence rules apply. | |
| 738 | 741 | ||
| 742 | + Packages whose names match `min-release-age-exclude` are exempt from this | ||
| 743 | + filter. | ||
| 744 | + | ||
| 745 | + This value is not exported to the environment for child processes. | ||
| 746 | + | ||
| 747 | + #### `min-release-age-exclude` | ||
| 748 | + | ||
| 749 | + * Default: | ||
| 750 | + * Type: String (can be set multiple times) | ||
| 751 | + | ||
| 752 | + A list of package names or `minimatch` glob patterns that are exempt from | ||
| 753 | + the `min-release-age` (and `before`) filter. A matching package can always | ||
| 754 | + resolve to its newest version, even when a release-age window is set. | ||
| 755 | + | ||
| 756 | + For example, to apply a release-age window to third-party dependencies while | ||
| 757 | + letting internally maintained packages update immediately: | ||
| 758 | + | ||
| 759 | + ``` | ||
| 760 | + min-release-age=7 | ||
| 761 | + min-release-age-exclude[]=@myorg/* | ||
| 762 | + min-release-age-exclude[]=my-internal-pkg | ||
| 763 | + ``` | ||
| 764 | + | ||
| 765 | + Only the named package is exempt; its own dependencies still follow the | ||
| 766 | + release-age policy unless they also match a pattern. Patterns match against | ||
| 767 | + the package name, so `@myorg/*` matches `@myorg/shared-utils`. | ||
| 768 | + | ||
| 769 | + Excluding a package does not change which registry it is fetched from. You | ||
| 770 | + should own your private scope on the public registry so that nobody else can | ||
| 771 | + publish a package with the same name. | ||
| 772 | + | ||
| 739 | 773 | This value is not exported to the environment for child processes. | |
| 740 | 774 | ||
| 741 | 775 | #### `bin-links` | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,9 +23,10 @@ List installed packages | |||
| 23 | 23 | * Default: false | |
| 24 | 24 | * Type: Boolean | |
| 25 | 25 | ||
| 26 | - When running `npm outdated` and `npm ls`, setting `--all` will show all | ||
| 27 | - outdated or installed packages, rather than only those directly depended | ||
| 28 | - upon by the current project. | ||
| 26 | + Show or act on all packages, not just the ones your project directly depends | ||
| 27 | + on. For `npm outdated` and `npm ls` this lists every outdated or installed | ||
| 28 | + package. For `npm approve-scripts` and `npm deny-scripts` it selects every | ||
| 29 | + package with pending install scripts. | ||
| 29 | 30 | ||
| 30 | 31 | ||
| 31 | 32 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,7 +23,7 @@ Note that nested packages will *also* show the paths to the specified packages. | |||
| 23 | 23 | For example, running `npm ls promzard` in npm's source tree will show: | |
| 24 | 24 | ||
| 25 | 25 | ```bash | |
| 26 | - npm@11.16.0 /path/to/npm | ||
| 26 | + npm@11.17.0 /path/to/npm | ||
| 27 | 27 | └─┬ init-package-json@0.0.4 | |
| 28 | 28 | └── promzard@0.1.5 | |
| 29 | 29 | ``` | |
@@ -43,9 +43,10 @@ When run as `ll` or `la`, it shows extended information by default. | |||
| 43 | 43 | * Default: false | |
| 44 | 44 | * Type: Boolean | |
| 45 | 45 | ||
| 46 | - When running `npm outdated` and `npm ls`, setting `--all` will show all | ||
| 47 | - outdated or installed packages, rather than only those directly depended | ||
| 48 | - upon by the current project. | ||
| 46 | + Show or act on all packages, not just the ones your project directly depends | ||
| 47 | + on. For `npm outdated` and `npm ls` this lists every outdated or installed | ||
| 48 | + package. For `npm approve-scripts` and `npm deny-scripts` it selects every | ||
| 49 | + package with pending install scripts. | ||
| 49 | 50 | ||
| 50 | 51 | ||
| 51 | 52 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,7 +20,7 @@ Use `--all` to find all outdated meta-dependencies as well. | |||
| 20 | 20 | In the output: | |
| 21 | 21 | ||
| 22 | 22 | * `wanted` is the maximum version of the package that satisfies the semver range specified in `package.json`. | |
| 23 | - If there's no available semver range (i.e. you're running `npm outdated --global`, or the package isn't included in `package.json`), then `wanted` shows the currently-installed version. | ||
| 23 | + If there's no available semver range (i.e. you're running `npm outdated --global`, or the package isn't included in `package.json`), then `wanted` shows the latest version. | ||
| 24 | 24 | * `latest` is the version of the package tagged as latest in the registry. | |
| 25 | 25 | Running `npm publish` with no special configuration will publish the package with a dist-tag of `latest`. | |
| 26 | 26 | This may or may not be the maximum version of the package, or the most-recently published version of the package, depending on how the package's developer manages the latest [dist-tag](/commands/npm-dist-tag). | |
@@ -73,9 +73,10 @@ A few things to note: | |||
| 73 | 73 | * Default: false | |
| 74 | 74 | * Type: Boolean | |
| 75 | 75 | ||
| 76 | - When running `npm outdated` and `npm ls`, setting `--all` will show all | ||
| 77 | - outdated or installed packages, rather than only those directly depended | ||
| 78 | - upon by the current project. | ||
| 76 | + Show or act on all packages, not just the ones your project directly depends | ||
| 77 | + on. For `npm outdated` and `npm ls` this lists every outdated or installed | ||
| 78 | + package. For `npm approve-scripts` and `npm deny-scripts` it selects every | ||
| 79 | + package with pending install scripts. | ||
| 79 | 80 | ||
| 80 | 81 | ||
| 81 | 82 | ||
@@ -171,6 +172,9 @@ sources, the standard precedence applies (cli > env > project > user > | |||
| 171 | 172 | global), so a higher-priority source can always relax or override a | |
| 172 | 173 | lower-priority one. | |
| 173 | 174 | ||
| 175 | + Packages whose names match `min-release-age-exclude` are exempt from this | ||
| 176 | + filter. | ||
| 177 | + | ||
| 174 | 178 | ||
| 175 | 179 | ||
| 176 | 180 | #### `min-release-age` | |
@@ -190,6 +194,37 @@ your `.npmrc` is preserved when npm internally spawns a sub-process with | |||
| 190 | 194 | apply, `before` wins within a single source and across sources the standard | |
| 191 | 195 | precedence rules apply. | |
| 192 | 196 | ||
| 197 | + Packages whose names match `min-release-age-exclude` are exempt from this | ||
| 198 | + filter. | ||
| 199 | + | ||
| 200 | + This value is not exported to the environment for child processes. | ||
| 201 | + | ||
| 202 | + #### `min-release-age-exclude` | ||
| 203 | + | ||
| 204 | + * Default: | ||
| 205 | + * Type: String (can be set multiple times) | ||
| 206 | + | ||
| 207 | + A list of package names or `minimatch` glob patterns that are exempt from | ||
| 208 | + the `min-release-age` (and `before`) filter. A matching package can always | ||
| 209 | + resolve to its newest version, even when a release-age window is set. | ||
| 210 | + | ||
| 211 | + For example, to apply a release-age window to third-party dependencies while | ||
| 212 | + letting internally maintained packages update immediately: | ||
| 213 | + | ||
| 214 | + ``` | ||
| 215 | + min-release-age=7 | ||
| 216 | + min-release-age-exclude[]=@myorg/* | ||
| 217 | + min-release-age-exclude[]=my-internal-pkg | ||
| 218 | + ``` | ||
| 219 | + | ||
| 220 | + Only the named package is exempt; its own dependencies still follow the | ||
| 221 | + release-age policy unless they also match a pattern. Patterns match against | ||
| 222 | + the package name, so `@myorg/*` matches `@myorg/shared-utils`. | ||
| 223 | + | ||
| 224 | + Excluding a package does not change which registry it is fetched from. You | ||
| 225 | + should own your private scope on the public registry so that nobody else can | ||
| 226 | + publish a package with the same name. | ||
| 227 | + | ||
| 193 | 228 | This value is not exported to the environment for child processes. | |
| 194 | 229 | ||
| 195 | 230 | ### See Also | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -262,6 +262,82 @@ This config cannot be used with: `expect-result-count` | |||
| 262 | 262 | Tells to expect a specific number of results from the command. | |
| 263 | 263 | ||
| 264 | 264 | This config cannot be used with: `expect-results` | |
| 265 | + | ||
| 266 | + #### `before` | ||
| 267 | + | ||
| 268 | + * Default: null | ||
| 269 | + * Type: null or Date | ||
| 270 | + | ||
| 271 | + If passed to `npm install`, will rebuild the npm tree such that only | ||
| 272 | + versions that were available **on or before** the given date are installed. | ||
| 273 | + If there are no versions available for the current set of dependencies, the | ||
| 274 | + command will error. | ||
| 275 | + | ||
| 276 | + If the requested version is a `dist-tag` and the given tag does not pass the | ||
| 277 | + `--before` filter, the most recent version less than or equal to that tag | ||
| 278 | + will be used. For example, `foo@latest` might install `foo@1.2` even though | ||
| 279 | + `latest` is `2.0`. | ||
| 280 | + | ||
| 281 | + If `before` and `min-release-age` are both set in the same source, `before` | ||
| 282 | + wins (an explicit absolute date overrides a relative window). Across | ||
| 283 | + sources, the standard precedence applies (cli > env > project > user > | ||
| 284 | + global), so a higher-priority source can always relax or override a | ||
| 285 | + lower-priority one. | ||
| 286 | + | ||
| 287 | + Packages whose names match `min-release-age-exclude` are exempt from this | ||
| 288 | + filter. | ||
| 289 | + | ||
| 290 | + | ||
| 291 | + | ||
| 292 | + #### `min-release-age` | ||
| 293 | + | ||
| 294 | + * Default: null | ||
| 295 | + * Type: null or Number | ||
| 296 | + | ||
| 297 | + If set, npm will build the npm tree such that only versions that were | ||
| 298 | + available more than the given number of days ago will be installed. If there | ||
| 299 | + are no versions available for the current set of dependencies, the command | ||
| 300 | + will error. | ||
| 301 | + | ||
| 302 | + This flag is a complement to `before`, which accepts an exact date instead | ||
| 303 | + of a relative number of days. The two may coexist (e.g. `min-release-age` in | ||
| 304 | + your `.npmrc` is preserved when npm internally spawns a sub-process with | ||
| 305 | + `--before` while preparing a `git:` or `github:` dependency); when both | ||
| 306 | + apply, `before` wins within a single source and across sources the standard | ||
| 307 | + precedence rules apply. | ||
| 308 | + | ||
| 309 | + Packages whose names match `min-release-age-exclude` are exempt from this | ||
| 310 | + filter. | ||
| 311 | + | ||
| 312 | + This value is not exported to the environment for child processes. | ||
| 313 | + | ||
| 314 | + #### `min-release-age-exclude` | ||
| 315 | + | ||
| 316 | + * Default: | ||
| 317 | + * Type: String (can be set multiple times) | ||
| 318 | + | ||
| 319 | + A list of package names or `minimatch` glob patterns that are exempt from | ||
| 320 | + the `min-release-age` (and `before`) filter. A matching package can always | ||
| 321 | + resolve to its newest version, even when a release-age window is set. | ||
| 322 | + | ||
| 323 | + For example, to apply a release-age window to third-party dependencies while | ||
| 324 | + letting internally maintained packages update immediately: | ||
| 325 | + | ||
| 326 | + ``` | ||
| 327 | + min-release-age=7 | ||
| 328 | + min-release-age-exclude[]=@myorg/* | ||
| 329 | + min-release-age-exclude[]=my-internal-pkg | ||
| 330 | + ``` | ||
| 331 | + | ||
| 332 | + Only the named package is exempt; its own dependencies still follow the | ||
| 333 | + release-age policy unless they also match a pattern. Patterns match against | ||
| 334 | + the package name, so `@myorg/*` matches `@myorg/shared-utils`. | ||
| 335 | + | ||
| 336 | + Excluding a package does not change which registry it is fetched from. You | ||
| 337 | + should own your private scope on the public registry so that nobody else can | ||
| 338 | + publish a package with the same name. | ||
| 339 | + | ||
| 340 | + This value is not exported to the environment for child processes. | ||
| 265 | 341 | ## See Also | |
| 266 | 342 | ||
| 267 | 343 | * [dependency selectors](/using-npm/dependency-selectors) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -151,7 +151,7 @@ npm stage publish <package-spec> | |||
| 151 | 151 | ||
| 152 | 152 | | Flag | Default | Type | Description | | |
| 153 | 153 | | --- | --- | --- | --- | | |
| 154 | - | `--tag` | "latest" | String | If you ask npm to install a package and don't tell it a specific version, then it will install the specified tag. It is the tag added to the package@version specified in the `npm dist-tag add` command, if no explicit tag is given. When used by the `npm diff` command, this is the tag used to fetch the tarball that will be compared with the local files by default. If used in the `npm publish` command, this is the tag that will be added to the package submitted to the registry. | | ||
| 154 | + | `--tag` | "latest" | String | If you ask npm to install a package and don't tell it a specific version, then it will install the specified tag. It is the tag added to the package@version specified in the `npm dist-tag add` command, if no explicit tag is given. When used by the `npm diff` command, this is the tag used to fetch the tarball that will be compared with the local files by default. If used in the `npm publish` command, this is the tag that will be added to the package submitted to the registry. | | ||
| 155 | 155 | | `--access` | 'public' for new packages, existing packages it will not change the current level | null, "restricted", "public", or "private" | If you do not want your scoped package to be publicly viewable (and installable) set `--access=restricted`. Unscoped packages cannot be set to `restricted`. Note: This defaults to not changing the current access level for existing packages. Specifying a value of `restricted` or `public` during publish will change the access for an existing package the same way that `npm access set status` would. The value `private` is an alias for `restricted`. | | |
| 156 | 156 | | `--dry-run` | false | Boolean | Indicates that you don't want npm to make any changes and that it should only report what it would have done. This can be passed into any of the commands that modify your local installation, eg, `install`, `update`, `dedupe`, `uninstall`, as well as `pack` and `publish`. Note: This is NOT honored by other network related commands, eg `dist-tags`, `owner`, etc. | | |
| 157 | 157 | | `--otp` | null | null or String | This is a one-time password from a two-factor authenticator. It's needed when publishing or changing package permissions with `npm access`. If not set, and a registry response fails with a challenge for a one-time password, npm will prompt on the command line for one. | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,7 +12,7 @@ Note: This command is unaware of workspaces. | |||
| 12 | 12 | ||
| 13 | 13 | Before using npm trust commands, ensure the following requirements are met: | |
| 14 | 14 | ||
| 15 | - * **npm version**: `npm@11.10.0` or above is required. Use `npm install -g npm@^11.10.0` to update if needed. | ||
| 15 | + * **npm version**: `npm@11.15.0` or above is required. Use `npm install -g npm@^11.15.0` to update if needed. | ||
| 16 | 16 | * **Write permissions on the package**: You must have write access to the package you're configuring. | |
| 17 | 17 | * **2FA enabled on account**: Two-factor authentication must be enabled at the account level. Even if it's not currently enabled, you must enable it to use trust commands. | |
| 18 | 18 | * **Supported authentication methods**: Granular Access Tokens (GAT) with the bypass 2FA option are not supported. Legacy basic auth (username and password) credentials will not work for trust commands or endpoints. | |
| Back | FazBrowse Home | New Git URL |
0 commit comments