Skip to content

deps: upgrade npm to 11.4.0 #58347

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
33 changes: 28 additions & 5 deletions deps/npm/bin/npm.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,34 @@ if (Test-Path $NPM_PREFIX_NPM_CLI_JS) {
$NPM_CLI_JS=$NPM_PREFIX_NPM_CLI_JS
}

# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & $NODE_EXE $NPM_CLI_JS $args
} else {
& $NODE_EXE $NPM_CLI_JS $args
if ($MyInvocation.Line) { # used "-Command" argument
if ($MyInvocation.Statement) {
$NPM_ARGS = $MyInvocation.Statement.Substring($MyInvocation.InvocationName.Length).Trim()
} else {
$NPM_OG_COMMAND = (
[System.Management.Automation.InvocationInfo].GetProperty('ScriptPosition', [System.Reflection.BindingFlags] 'Instance, NonPublic')
).GetValue($MyInvocation).Text
$NPM_ARGS = $NPM_OG_COMMAND.Substring($MyInvocation.InvocationName.Length).Trim()
}

$NODE_EXE = $NODE_EXE.Replace("``", "````")
$NPM_CLI_JS = $NPM_CLI_JS.Replace("``", "````")

# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input = (@($input) -join "`n").Replace("``", "````")

Invoke-Expression "Write-Output `"$input`" | & `"$NODE_EXE`" `"$NPM_CLI_JS`" $NPM_ARGS"
} else {
Invoke-Expression "& `"$NODE_EXE`" `"$NPM_CLI_JS`" $NPM_ARGS"
}
} else { # used "-File" argument
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & $NODE_EXE $NPM_CLI_JS $args
} else {
& $NODE_EXE $NPM_CLI_JS $args
}
}

exit $LASTEXITCODE
33 changes: 28 additions & 5 deletions deps/npm/bin/npx.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,34 @@ if (Test-Path $NPM_PREFIX_NPX_CLI_JS) {
$NPX_CLI_JS=$NPM_PREFIX_NPX_CLI_JS
}

# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & $NODE_EXE $NPX_CLI_JS $args
} else {
& $NODE_EXE $NPX_CLI_JS $args
if ($MyInvocation.Line) { # used "-Command" argument
if ($MyInvocation.Statement) {
$NPX_ARGS = $MyInvocation.Statement.Substring($MyInvocation.InvocationName.Length).Trim()
} else {
$NPX_OG_COMMAND = (
[System.Management.Automation.InvocationInfo].GetProperty('ScriptPosition', [System.Reflection.BindingFlags] 'Instance, NonPublic')
).GetValue($MyInvocation).Text
$NPX_ARGS = $NPX_OG_COMMAND.Substring($MyInvocation.InvocationName.Length).Trim()
}

$NODE_EXE = $NODE_EXE.Replace("``", "````")
$NPX_CLI_JS = $NPX_CLI_JS.Replace("``", "````")

# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input = (@($input) -join "`n").Replace("``", "````")

Invoke-Expression "Write-Output `"$input`" | & `"$NODE_EXE`" `"$NPX_CLI_JS`" $NPX_ARGS"
} else {
Invoke-Expression "& `"$NODE_EXE`" `"$NPX_CLI_JS`" $NPX_ARGS"
}
} else { # used "-File" argument
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & $NODE_EXE $NPX_CLI_JS $args
} else {
& $NODE_EXE $NPX_CLI_JS $args
}
}

exit $LASTEXITCODE
2 changes: 2 additions & 0 deletions deps/npm/docs/content/commands/npm-adduser.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Create a new user in the specified registry, and save the credentials to
the `.npmrc` file. If no registry is specified, the default registry
will be used (see [`registry`](/using-npm/registry)).

When you run `npm adduser`, the CLI automatically generates a legacy token of `publish` type. For more information, see [About legacy tokens](/about-access-tokens#about-legacy-tokens).

When using `legacy` for your `auth-type`, the username, password, and
email are read in from prompts.

Expand Down
6 changes: 3 additions & 3 deletions deps/npm/docs/content/commands/npm-audit.md
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,9 @@ but can be useful for debugging.
If true, npm does not run scripts specified in package.json files.

Note that commands explicitly intended to run a particular script, such as
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
will still run their intended script if `ignore-scripts` is set, but they
will *not* run any pre- or post-scripts.
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still
run their intended script if `ignore-scripts` is set, but they will *not*
run any pre- or post-scripts.



Expand Down
6 changes: 3 additions & 3 deletions deps/npm/docs/content/commands/npm-ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ but can be useful for debugging.
If true, npm does not run scripts specified in package.json files.

Note that commands explicitly intended to run a particular script, such as
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
will still run their intended script if `ignore-scripts` is set, but they
will *not* run any pre- or post-scripts.
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still
run their intended script if `ignore-scripts` is set, but they will *not*
run any pre- or post-scripts.



Expand Down
6 changes: 3 additions & 3 deletions deps/npm/docs/content/commands/npm-dedupe.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ the order in which omit/include are specified on the command-line.
If true, npm does not run scripts specified in package.json files.
Note that commands explicitly intended to run a particular script, such as
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
will still run their intended script if `ignore-scripts` is set, but they
will *not* run any pre- or post-scripts.
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still
run their intended script if `ignore-scripts` is set, but they will *not*
run any pre- or post-scripts.
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/content/commands/npm-exec.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ project.

### See Also

* [npm run-script](/commands/npm-run-script)
* [npm run](/commands/npm-run)
* [npm scripts](/using-npm/scripts)
* [npm test](/commands/npm-test)
* [npm start](/commands/npm-start)
Expand Down
6 changes: 3 additions & 3 deletions deps/npm/docs/content/commands/npm-find-dupes.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ the order in which omit/include are specified on the command-line.
If true, npm does not run scripts specified in package.json files.

Note that commands explicitly intended to run a particular script, such as
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
will still run their intended script if `ignore-scripts` is set, but they
will *not* run any pre- or post-scripts.
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still
run their intended script if `ignore-scripts` is set, but they will *not*
run any pre- or post-scripts.



Expand Down
14 changes: 14 additions & 0 deletions deps/npm/docs/content/commands/npm-init.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ Generate it without having it ask any questions:
$ npm init -y
```

Set the private flag to `true` in package.json:
```bash
$ npm init --init-private -y
```

### Workspaces support

It's possible to create a new workspace within your project by using the
Expand Down Expand Up @@ -216,6 +221,15 @@ number, if not already set in package.json.



#### `init-private`

* Default: false
* Type: Boolean

The value `npm init` should use by default for the package's private flag.



#### `yes`

* Default: null
Expand Down
6 changes: 3 additions & 3 deletions deps/npm/docs/content/commands/npm-install-ci-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ but can be useful for debugging.
If true, npm does not run scripts specified in package.json files.

Note that commands explicitly intended to run a particular script, such as
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
will still run their intended script if `ignore-scripts` is set, but they
will *not* run any pre- or post-scripts.
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still
run their intended script if `ignore-scripts` is set, but they will *not*
run any pre- or post-scripts.



Expand Down
6 changes: 3 additions & 3 deletions deps/npm/docs/content/commands/npm-install-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ but can be useful for debugging.
If true, npm does not run scripts specified in package.json files.

Note that commands explicitly intended to run a particular script, such as
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
will still run their intended script if `ignore-scripts` is set, but they
will *not* run any pre- or post-scripts.
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still
run their intended script if `ignore-scripts` is set, but they will *not*
run any pre- or post-scripts.



Expand Down
6 changes: 3 additions & 3 deletions deps/npm/docs/content/commands/npm-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -601,9 +601,9 @@ but can be useful for debugging.
If true, npm does not run scripts specified in package.json files.

Note that commands explicitly intended to run a particular script, such as
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
will still run their intended script if `ignore-scripts` is set, but they
will *not* run any pre- or post-scripts.
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still
run their intended script if `ignore-scripts` is set, but they will *not*
run any pre- or post-scripts.



Expand Down
6 changes: 3 additions & 3 deletions deps/npm/docs/content/commands/npm-link.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,9 @@ the order in which omit/include are specified on the command-line.
If true, npm does not run scripts specified in package.json files.

Note that commands explicitly intended to run a particular script, such as
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
will still run their intended script if `ignore-scripts` is set, but they
will *not* run any pre- or post-scripts.
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still
run their intended script if `ignore-scripts` is set, but they will *not*
run any pre- or post-scripts.



Expand Down
2 changes: 2 additions & 0 deletions deps/npm/docs/content/commands/npm-login.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Verify a user in the specified registry, and save the credentials to the
`.npmrc` file. If no registry is specified, the default registry will be
used (see [`config`](/using-npm/config)).

When you run `npm login`, the CLI automatically generates a legacy token of `publish` type. For more information, see [About legacy tokens](/about-access-tokens#about-legacy-tokens).

When using `legacy` for your `auth-type`, the username and password, are
read in from prompts.

Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/content/commands/npm-ls.md
Original file line number Diff line number Diff line change
Expand Up @@ -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@11.3.0 /path/to/npm
npm@11.4.0 /path/to/npm
└─┬ [email protected]
└── [email protected]
```
Expand Down
1 change: 1 addition & 0 deletions deps/npm/docs/content/commands/npm-outdated.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ In the output:
included in `package.json` are always marked `dependencies`.
* `homepage` (when using `--long` / `-l`) is the `homepage` value contained
in the package's packument
* `depended by location` (when using `--long` / `-l`) shows location of the package that depends on the displayed dependency
* Red means there's a newer version matching your semver requirements, so
you should update now.
* Yellow indicates that there's a newer version _above_ your semver
Expand Down
6 changes: 3 additions & 3 deletions deps/npm/docs/content/commands/npm-pack.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ This value is not exported to the environment for child processes.
If true, npm does not run scripts specified in package.json files.

Note that commands explicitly intended to run a particular script, such as
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
will still run their intended script if `ignore-scripts` is set, but they
will *not* run any pre- or post-scripts.
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still
run their intended script if `ignore-scripts` is set, but they will *not*
run any pre- or post-scripts.



Expand Down
6 changes: 3 additions & 3 deletions deps/npm/docs/content/commands/npm-prune.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ but can be useful for debugging.
If true, npm does not run scripts specified in package.json files.

Note that commands explicitly intended to run a particular script, such as
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
will still run their intended script if `ignore-scripts` is set, but they
will *not* run any pre- or post-scripts.
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still
run their intended script if `ignore-scripts` is set, but they will *not*
run any pre- or post-scripts.



Expand Down
6 changes: 3 additions & 3 deletions deps/npm/docs/content/commands/npm-rebuild.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ but can be useful for debugging.
If true, npm does not run scripts specified in package.json files.

Note that commands explicitly intended to run a particular script, such as
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
will still run their intended script if `ignore-scripts` is set, but they
will *not* run any pre- or post-scripts.
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still
run their intended script if `ignore-scripts` is set, but they will *not*
run any pre- or post-scripts.



Expand Down
10 changes: 5 additions & 5 deletions deps/npm/docs/content/commands/npm-restart.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ npm restart [-- <args>]

### Description

This restarts a project. It is equivalent to running `npm run-script
This restarts a project. It is equivalent to running `npm run
restart`.

If the current project has a `"restart"` script specified in
Expand Down Expand Up @@ -44,9 +44,9 @@ If it does _not_ have a `"restart"` script specified, but it does have
If true, npm does not run scripts specified in package.json files.

Note that commands explicitly intended to run a particular script, such as
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
will still run their intended script if `ignore-scripts` is set, but they
will *not* run any pre- or post-scripts.
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still
run their intended script if `ignore-scripts` is set, but they will *not*
run any pre- or post-scripts.



Expand All @@ -62,7 +62,7 @@ init <package-spec>` commands.

### See Also

* [npm run-script](/commands/npm-run-script)
* [npm run](/commands/npm-run)
* [npm scripts](/using-npm/scripts)
* [npm test](/commands/npm-test)
* [npm start](/commands/npm-start)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
title: npm-run-script
title: npm-run
section: 1
description: Run arbitrary package scripts
---

### Synopsis

```bash
npm run-script <command> [-- <args>]
npm run <command> [-- <args>]

aliases: run, rum, urn
aliases: run-script, rum, urn
```

### Description
Expand Down Expand Up @@ -195,10 +195,10 @@ This value is not exported to the environment for child processes.
* Default: false
* Type: Boolean

If true, npm will not exit with an error code when `run-script` is invoked
for a script that isn't defined in the `scripts` section of `package.json`.
This option can be used when it's desirable to optionally run a script when
it's present and fail if the script fails. This is useful, for example, when
If true, npm will not exit with an error code when `run` is invoked for a
script that isn't defined in the `scripts` section of `package.json`. This
option can be used when it's desirable to optionally run a script when it's
present and fail if the script fails. This is useful, for example, when
running scripts that may only apply for some builds in an otherwise generic
CI setup.

Expand All @@ -212,9 +212,9 @@ This value is not exported to the environment for child processes.
If true, npm does not run scripts specified in package.json files.

Note that commands explicitly intended to run a particular script, such as
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
will still run their intended script if `ignore-scripts` is set, but they
will *not* run any pre- or post-scripts.
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still
run their intended script if `ignore-scripts` is set, but they will *not*
run any pre- or post-scripts.



Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/content/commands/npm-shrinkwrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ design and purpose of package locks in npm, see
### See Also

* [npm install](/commands/npm-install)
* [npm run-script](/commands/npm-run-script)
* [npm run](/commands/npm-run)
* [npm scripts](/using-npm/scripts)
* [package.json](/configuring-npm/package-json)
* [package-lock.json](/configuring-npm/package-lock-json)
Expand Down
Loading
Loading