Skip to content

Commit 150e155

Browse files
npm-cli-botjuanarbol
authored andcommitted
deps: upgrade npm to 9.8.0
PR-URL: #48665 Reviewed-By: Luke Karrys <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]>
1 parent 999ae0c commit 150e155

File tree

135 files changed

+941
-570
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+941
-570
lines changed

deps/npm/bin/npm

+22-5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@ case `uname` in
1111
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
1212
esac
1313

14+
if [ `uname` = 'Linux' ] && type wslpath &>/dev/null ; then
15+
IS_WSL="true"
16+
fi
17+
18+
function no_node_dir {
19+
# if this didn't work, then everything else below will fail
20+
echo "Could not determine Node.js install directory" >&2
21+
exit 1
22+
}
23+
1424
NODE_EXE="$basedir/node.exe"
1525
if ! [ -x "$NODE_EXE" ]; then
1626
NODE_EXE="$basedir/node"
@@ -21,13 +31,20 @@ fi
2131

2232
# this path is passed to node.exe, so it needs to match whatever
2333
# kind of paths Node.js thinks it's using, typically win32 paths.
24-
CLI_BASEDIR="$("$NODE_EXE" -p 'require("path").dirname(process.execPath)')"
34+
CLI_BASEDIR="$("$NODE_EXE" -p 'require("path").dirname(process.execPath)' 2> /dev/null)"
35+
if [ $? -ne 0 ]; then
36+
# this fails under WSL 1 so add an additional message. we also suppress stderr above
37+
# because the actual error raised is not helpful. in WSL 1 node.exe cannot handle
38+
# output redirection properly. See https://github.com/microsoft/WSL/issues/2370
39+
if [ "$IS_WSL" == "true" ]; then
40+
echo "WSL 1 is not supported. Please upgrade to WSL 2 or above." >&2
41+
fi
42+
no_node_dir
43+
fi
2544
NPM_CLI_JS="$CLI_BASEDIR/node_modules/npm/bin/npm-cli.js"
2645
NPM_PREFIX=`"$NODE_EXE" "$NPM_CLI_JS" prefix -g`
2746
if [ $? -ne 0 ]; then
28-
# if this didn't work, then everything else below will fail
29-
echo "Could not determine Node.js install directory" >&2
30-
exit 1
47+
no_node_dir
3148
fi
3249
NPM_PREFIX_NPM_CLI_JS="$NPM_PREFIX/node_modules/npm/bin/npm-cli.js"
3350

@@ -37,7 +54,7 @@ NPM_WSL_PATH="/.."
3754
# WSL can run Windows binaries, so we have to give it the win32 path
3855
# however, WSL bash tests against posix paths, so we need to construct that
3956
# to know if npm is installed globally.
40-
if [ `uname` = 'Linux' ] && type wslpath &>/dev/null ; then
57+
if [ "$IS_WSL" == "true" ]; then
4158
NPM_WSL_PATH=`wslpath "$NPM_PREFIX_NPM_CLI_JS"`
4259
fi
4360
if [ -f "$NPM_PREFIX_NPM_CLI_JS" ] || [ -f "$NPM_WSL_PATH" ]; then

deps/npm/bin/npm.ps1

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env pwsh
2+
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
3+
4+
$exe=""
5+
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
6+
# Fix case when both the Windows and Linux builds of Node
7+
# are installed in the same directory
8+
$exe=".exe"
9+
}
10+
$ret=0
11+
12+
$nodeexe = "node$exe"
13+
$nodebin = $(Get-Command $nodeexe -ErrorAction SilentlyContinue -ErrorVariable F).Source
14+
if ($nodebin -eq $null) {
15+
Write-Host "$nodeexe not found."
16+
exit 1
17+
}
18+
$nodedir = $(New-Object -ComObject Scripting.FileSystemObject).GetFile("$nodebin").ParentFolder.Path
19+
20+
$npmclijs="$nodedir/node_modules/npm/bin/npm-cli.js"
21+
$npmprefix=(& $nodeexe $npmclijs prefix -g)
22+
if ($LASTEXITCODE -ne 0) {
23+
Write-Host "Could not determine Node.js install directory"
24+
exit 1
25+
}
26+
$npmprefixclijs="$npmprefix/node_modules/npm/bin/npm-cli.js"
27+
28+
# Support pipeline input
29+
if ($MyInvocation.ExpectingInput) {
30+
$input | & $nodeexe $npmprefixclijs $args
31+
} else {
32+
& $nodeexe $npmprefixclijs $args
33+
}
34+
$ret=$LASTEXITCODE
35+
exit $ret

deps/npm/bin/npx

+22-5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@ case `uname` in
1111
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
1212
esac
1313

14+
if [ `uname` = 'Linux' ] && type wslpath &>/dev/null ; then
15+
IS_WSL="true"
16+
fi
17+
18+
function no_node_dir {
19+
# if this didn't work, then everything else below will fail
20+
echo "Could not determine Node.js install directory" >&2
21+
exit 1
22+
}
23+
1424
NODE_EXE="$basedir/node.exe"
1525
if ! [ -x "$NODE_EXE" ]; then
1626
NODE_EXE="$basedir/node"
@@ -21,14 +31,21 @@ fi
2131

2232
# this path is passed to node.exe, so it needs to match whatever
2333
# kind of paths Node.js thinks it's using, typically win32 paths.
24-
CLI_BASEDIR="$("$NODE_EXE" -p 'require("path").dirname(process.execPath)')"
34+
CLI_BASEDIR="$("$NODE_EXE" -p 'require("path").dirname(process.execPath)' 2> /dev/null)"
35+
if [ $? -ne 0 ]; then
36+
# this fails under WSL 1 so add an additional message. we also suppress stderr above
37+
# because the actual error raised is not helpful. in WSL 1 node.exe cannot handle
38+
# output redirection properly. See https://github.com/microsoft/WSL/issues/2370
39+
if [ "$IS_WSL" == "true" ]; then
40+
echo "WSL 1 is not supported. Please upgrade to WSL 2 or above." >&2
41+
fi
42+
no_node_dir
43+
fi
2544
NPM_CLI_JS="$CLI_BASEDIR/node_modules/npm/bin/npm-cli.js"
2645
NPX_CLI_JS="$CLI_BASEDIR/node_modules/npm/bin/npx-cli.js"
2746
NPM_PREFIX=`"$NODE_EXE" "$NPM_CLI_JS" prefix -g`
2847
if [ $? -ne 0 ]; then
29-
# if this didn't work, then everything else below will fail
30-
echo "Could not determine Node.js install directory" >&2
31-
exit 1
48+
no_node_dir
3249
fi
3350
NPM_PREFIX_NPX_CLI_JS="$NPM_PREFIX/node_modules/npm/bin/npx-cli.js"
3451

@@ -38,7 +55,7 @@ NPX_WSL_PATH="/.."
3855
# WSL can run Windows binaries, so we have to give it the win32 path
3956
# however, WSL bash tests against posix paths, so we need to construct that
4057
# to know if npm is installed globally.
41-
if [ `uname` = 'Linux' ] && type wslpath &>/dev/null ; then
58+
if [ "$IS_WSL" == "true" ]; then
4259
NPX_WSL_PATH=`wslpath "$NPM_PREFIX_NPX_CLI_JS"`
4360
fi
4461
if [ -f "$NPM_PREFIX_NPX_CLI_JS" ] || [ -f "$NPX_WSL_PATH" ]; then

deps/npm/bin/npx.ps1

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env pwsh
2+
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
3+
4+
$exe=""
5+
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
6+
# Fix case when both the Windows and Linux builds of Node
7+
# are installed in the same directory
8+
$exe=".exe"
9+
}
10+
$ret=0
11+
12+
$nodeexe = "node$exe"
13+
$nodebin = $(Get-Command $nodeexe -ErrorAction SilentlyContinue -ErrorVariable F).Source
14+
if ($nodebin -eq $null) {
15+
Write-Host "$nodeexe not found."
16+
exit 1
17+
}
18+
$nodedir = $(New-Object -ComObject Scripting.FileSystemObject).GetFile("$nodebin").ParentFolder.Path
19+
20+
$npmclijs="$nodedir/node_modules/npm/bin/npm-cli.js"
21+
$npmprefix=(& $nodeexe $npmclijs prefix -g)
22+
if ($LASTEXITCODE -ne 0) {
23+
Write-Host "Could not determine Node.js install directory"
24+
exit 1
25+
}
26+
$npmprefixclijs="$npmprefix/node_modules/npm/bin/npx-cli.js"
27+
28+
# Support pipeline input
29+
if ($MyInvocation.ExpectingInput) {
30+
$input | & $nodeexe $npmprefixclijs $args
31+
} else {
32+
& $nodeexe $npmprefixclijs $args
33+
}
34+
$ret=$LASTEXITCODE
35+
exit $ret

deps/npm/docs/content/commands/npm-ls.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ packages will *also* show the paths to the specified packages. For
2727
example, running `npm ls promzard` in npm's source tree will show:
2828

2929
```bash
30-
npm@9.7.2 /path/to/npm
30+
npm@9.8.0 /path/to/npm
3131
3232
3333
```

deps/npm/docs/content/commands/npm-pkg.md

+8
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ npm pkg get [<key> [<key> ...]]
1212
npm pkg delete <key> [<key> ...]
1313
npm pkg set [<array>[<index>].<key>=<value> ...]
1414
npm pkg set [<array>[].<key>=<value> ...]
15+
npm pkg fix
1516
```
1617
1718
### Description
@@ -141,6 +142,13 @@ Returned values are always in **json** format.
141142
npm pkg delete scripts.build
142143
```
143144
145+
* `npm pkg fix`
146+
147+
Auto corrects common errors in your `package.json`. npm already
148+
does this during `publish`, which leads to subtle (mostly harmless)
149+
differences between the contents of your `package.json` file and the
150+
manifest that npm uses during installation.
151+
144152
### Workspaces support
145153
146154
You can set/get/delete items across your configured workspaces by using the

deps/npm/docs/content/commands/npm.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Note: This command is unaware of workspaces.
1414

1515
### Version
1616

17-
9.7.2
17+
9.8.0
1818

1919
### Description
2020

deps/npm/docs/output/commands/npm-ls.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ <h3 id="description">Description</h3>
160160
the results to only the paths to the packages named. Note that nested
161161
packages will <em>also</em> show the paths to the specified packages. For
162162
example, running <code>npm ls promzard</code> in npm's source tree will show:</p>
163-
<pre><code class="language-bash">npm@9.7.2 /path/to/npm
163+
<pre><code class="language-bash">npm@9.8.0 /path/to/npm
164164
165165
166166
</code></pre>

deps/npm/docs/output/commands/npm-pkg.html

+8
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ <h2 id="table-of-contents">Table of contents</h2>
151151
npm pkg delete &lt;key&gt; [&lt;key&gt; ...]
152152
npm pkg set [&lt;array&gt;[&lt;index&gt;].&lt;key&gt;=&lt;value&gt; ...]
153153
npm pkg set [&lt;array&gt;[].&lt;key&gt;=&lt;value&gt; ...]
154+
npm pkg fix
154155
</code></pre>
155156
<h3 id="description">Description</h3>
156157
<p>A command that automates the management of <code>package.json</code> files.
@@ -236,6 +237,13 @@ <h3 id="description">Description</h3>
236237
<pre><code class="language-bash">npm pkg delete scripts.build
237238
</code></pre>
238239
</li>
240+
<li>
241+
<p><code>npm pkg fix</code></p>
242+
<p>Auto corrects common errors in your <code>package.json</code>. npm already
243+
does this during <code>publish</code>, which leads to subtle (mostly harmless)
244+
differences between the contents of your <code>package.json</code> file and the
245+
manifest that npm uses during installation.</p>
246+
</li>
239247
</ul>
240248
<h3 id="workspaces-support">Workspaces support</h3>
241249
<p>You can set/get/delete items across your configured workspaces by using the

deps/npm/docs/output/commands/npm.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ <h2 id="table-of-contents">Table of contents</h2>
150150
</code></pre>
151151
<p>Note: This command is unaware of workspaces.</p>
152152
<h3 id="version">Version</h3>
153-
<p>9.7.2</p>
153+
<p>9.8.0</p>
154154
<h3 id="description">Description</h3>
155155
<p>npm is the package manager for the Node JavaScript platform. It puts
156156
modules in place so that node can find them, and manages dependency

deps/npm/lib/commands/pkg.js

+8
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ class Pkg extends BaseCommand {
1111
'delete <key> [<key> ...]',
1212
'set [<array>[<index>].<key>=<value> ...]',
1313
'set [<array>[].<key>=<value> ...]',
14+
'fix',
1415
]
1516

1617
static params = [
@@ -45,6 +46,8 @@ class Pkg extends BaseCommand {
4546
return this.set(_args)
4647
case 'delete':
4748
return this.delete(_args)
49+
case 'fix':
50+
return this.fix(_args)
4851
default:
4952
throw this.usageError()
5053
}
@@ -136,6 +139,11 @@ class Pkg extends BaseCommand {
136139
pkgJson.update(q.toJSON())
137140
await pkgJson.save()
138141
}
142+
143+
async fix () {
144+
const pkgJson = await PackageJson.fix(this.prefix)
145+
await pkgJson.save()
146+
}
139147
}
140148

141149
module.exports = Pkg

deps/npm/man/man1/npm-access.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "NPM-ACCESS" "1" "June 2023" "" ""
1+
.TH "NPM-ACCESS" "1" "July 2023" "" ""
22
.SH "NAME"
33
\fBnpm-access\fR - Set access level on published packages
44
.SS "Synopsis"

deps/npm/man/man1/npm-adduser.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "NPM-ADDUSER" "1" "June 2023" "" ""
1+
.TH "NPM-ADDUSER" "1" "July 2023" "" ""
22
.SH "NAME"
33
\fBnpm-adduser\fR - Add a registry user account
44
.SS "Synopsis"

deps/npm/man/man1/npm-audit.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "NPM-AUDIT" "1" "June 2023" "" ""
1+
.TH "NPM-AUDIT" "1" "July 2023" "" ""
22
.SH "NAME"
33
\fBnpm-audit\fR - Run a security audit
44
.SS "Synopsis"

deps/npm/man/man1/npm-bugs.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "NPM-BUGS" "1" "June 2023" "" ""
1+
.TH "NPM-BUGS" "1" "July 2023" "" ""
22
.SH "NAME"
33
\fBnpm-bugs\fR - Report bugs for a package in a web browser
44
.SS "Synopsis"

deps/npm/man/man1/npm-cache.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "NPM-CACHE" "1" "June 2023" "" ""
1+
.TH "NPM-CACHE" "1" "July 2023" "" ""
22
.SH "NAME"
33
\fBnpm-cache\fR - Manipulates packages cache
44
.SS "Synopsis"

deps/npm/man/man1/npm-ci.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "NPM-CI" "1" "June 2023" "" ""
1+
.TH "NPM-CI" "1" "July 2023" "" ""
22
.SH "NAME"
33
\fBnpm-ci\fR - Clean install a project
44
.SS "Synopsis"

deps/npm/man/man1/npm-completion.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "NPM-COMPLETION" "1" "June 2023" "" ""
1+
.TH "NPM-COMPLETION" "1" "July 2023" "" ""
22
.SH "NAME"
33
\fBnpm-completion\fR - Tab Completion for npm
44
.SS "Synopsis"

deps/npm/man/man1/npm-config.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "NPM-CONFIG" "1" "June 2023" "" ""
1+
.TH "NPM-CONFIG" "1" "July 2023" "" ""
22
.SH "NAME"
33
\fBnpm-config\fR - Manage the npm configuration files
44
.SS "Synopsis"

deps/npm/man/man1/npm-dedupe.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "NPM-DEDUPE" "1" "June 2023" "" ""
1+
.TH "NPM-DEDUPE" "1" "July 2023" "" ""
22
.SH "NAME"
33
\fBnpm-dedupe\fR - Reduce duplication in the package tree
44
.SS "Synopsis"

deps/npm/man/man1/npm-deprecate.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "NPM-DEPRECATE" "1" "June 2023" "" ""
1+
.TH "NPM-DEPRECATE" "1" "July 2023" "" ""
22
.SH "NAME"
33
\fBnpm-deprecate\fR - Deprecate a version of a package
44
.SS "Synopsis"

deps/npm/man/man1/npm-diff.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "NPM-DIFF" "1" "June 2023" "" ""
1+
.TH "NPM-DIFF" "1" "July 2023" "" ""
22
.SH "NAME"
33
\fBnpm-diff\fR - The registry diff command
44
.SS "Synopsis"

deps/npm/man/man1/npm-dist-tag.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "NPM-DIST-TAG" "1" "June 2023" "" ""
1+
.TH "NPM-DIST-TAG" "1" "July 2023" "" ""
22
.SH "NAME"
33
\fBnpm-dist-tag\fR - Modify package distribution tags
44
.SS "Synopsis"

deps/npm/man/man1/npm-docs.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "NPM-DOCS" "1" "June 2023" "" ""
1+
.TH "NPM-DOCS" "1" "July 2023" "" ""
22
.SH "NAME"
33
\fBnpm-docs\fR - Open documentation for a package in a web browser
44
.SS "Synopsis"

deps/npm/man/man1/npm-doctor.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "NPM-DOCTOR" "1" "June 2023" "" ""
1+
.TH "NPM-DOCTOR" "1" "July 2023" "" ""
22
.SH "NAME"
33
\fBnpm-doctor\fR - Check your npm environment
44
.SS "Synopsis"

deps/npm/man/man1/npm-edit.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "NPM-EDIT" "1" "June 2023" "" ""
1+
.TH "NPM-EDIT" "1" "July 2023" "" ""
22
.SH "NAME"
33
\fBnpm-edit\fR - Edit an installed package
44
.SS "Synopsis"

deps/npm/man/man1/npm-exec.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "NPM-EXEC" "1" "June 2023" "" ""
1+
.TH "NPM-EXEC" "1" "July 2023" "" ""
22
.SH "NAME"
33
\fBnpm-exec\fR - Run a command from a local or remote npm package
44
.SS "Synopsis"

deps/npm/man/man1/npm-explain.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "NPM-EXPLAIN" "1" "June 2023" "" ""
1+
.TH "NPM-EXPLAIN" "1" "July 2023" "" ""
22
.SH "NAME"
33
\fBnpm-explain\fR - Explain installed packages
44
.SS "Synopsis"

deps/npm/man/man1/npm-explore.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "NPM-EXPLORE" "1" "June 2023" "" ""
1+
.TH "NPM-EXPLORE" "1" "July 2023" "" ""
22
.SH "NAME"
33
\fBnpm-explore\fR - Browse an installed package
44
.SS "Synopsis"

deps/npm/man/man1/npm-find-dupes.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "NPM-FIND-DUPES" "1" "June 2023" "" ""
1+
.TH "NPM-FIND-DUPES" "1" "July 2023" "" ""
22
.SH "NAME"
33
\fBnpm-find-dupes\fR - Find duplication in the package tree
44
.SS "Synopsis"

0 commit comments

Comments
 (0)