Skip to content

Commit d9ff473

Browse files
npm-cli-botruyadorno
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 4a6177d commit d9ff473

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‎

Lines changed: 22 additions & 5 deletions
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+
functionno_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‎

Lines changed: 35 additions & 0 deletions
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+
exit1
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-ne0){
23+
Write-Host"Could not determine Node.js install directory"
24+
exit1
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‎

Lines changed: 22 additions & 5 deletions
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+
functionno_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‎

Lines changed: 35 additions & 0 deletions
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+
exit1
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-ne0){
23+
Write-Host"Could not determine Node.js install directory"
24+
exit1
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‎

Lines changed: 1 addition & 1 deletion
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‎

Lines changed: 8 additions & 0 deletions
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‎

Lines changed: 1 addition & 1 deletion
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‎

Lines changed: 1 addition & 1 deletion
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><codeclass="language-bash">npm@9.7.2 /path/to/npm
163+
<pre><codeclass="language-bash">npm@9.8.0 /path/to/npm
164164
165165
166166
</code></pre>

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

Lines changed: 8 additions & 0 deletions
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
<h3id="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><codeclass="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
<h3id="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‎

Lines changed: 1 addition & 1 deletion
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
<h3id="version">Version</h3>
153-
<p>9.7.2</p>
153+
<p>9.8.0</p>
154154
<h3id="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

0 commit comments

Comments
(0)