Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d9ff473

Browse filesBrowse files
npm-cli-botruyadorno
authored andcommitted
deps: upgrade npm to 9.8.0
PR-URL: #48665 Reviewed-By: Luke Karrys <luke@lukekarrys.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
1 parent 4a6177d commit d9ff473
Copy full SHA for d9ff473

File tree

Expand file treeCollapse file tree

135 files changed

+941
-570
lines changed
Open diff view settings
Filter options

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree

135 files changed

+941
-570
lines changed
Open diff view settings
Collapse file

‎deps/npm/bin/npm‎

Copy file name to clipboardExpand all lines: deps/npm/bin/npm
+22-5Lines 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+
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
Collapse file

‎deps/npm/bin/npm.ps1‎

Copy file name to clipboard
+35Lines 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+
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
Collapse file

‎deps/npm/bin/npx‎

Copy file name to clipboardExpand all lines: deps/npm/bin/npx
+22-5Lines 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+
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
Collapse file

‎deps/npm/bin/npx.ps1‎

Copy file name to clipboard
+35Lines 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+
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
Collapse file

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

Copy file name to clipboardExpand all lines: deps/npm/docs/content/commands/npm-ls.md
+1-1Lines changed: 1 addition & 1 deletion
  • Display the source diff
  • Display the rich diff
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
└─┬ init-package-json@0.0.4
3232
└── promzard@0.1.5
3333
```
Collapse file

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

Copy file name to clipboardExpand all lines: deps/npm/docs/content/commands/npm-pkg.md
+8Lines changed: 8 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
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
Collapse file

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

Copy file name to clipboardExpand all lines: deps/npm/docs/content/commands/npm.md
+1-1Lines changed: 1 addition & 1 deletion
  • Display the source diff
  • Display the rich diff
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

Collapse file

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

Copy file name to clipboardExpand all lines: deps/npm/docs/output/commands/npm-ls.html
+1-1Lines 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><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
└─┬ init-package-json@0.0.4
165165
└── promzard@0.1.5
166166
</code></pre>
Collapse file

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

Copy file name to clipboardExpand all lines: deps/npm/docs/output/commands/npm-pkg.html
+8Lines 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
<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
Collapse file

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

Copy file name to clipboardExpand all lines: deps/npm/docs/output/commands/npm.html
+1-1Lines 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
<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

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.