Skip to content

Commit 4d86020

Browse files
authored
tools: install npm PowerShell scripts on Windows
npm 9.8.0 added PowerShell scripts that should be installed alongside the cmd and shell scripts on Windows. Fixes: #48471 Refs: npm/cli#6548 PR-URL: #52009 Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 081319d commit 4d86020

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

tools/msvs/msi/nodemsi/product.wxs

+10
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,10 @@
8888
Description="!(loc.npm_Description)">
8989
<ComponentRef Id="NpmCmdScript"/>
9090
<ComponentRef Id="NpmBashScript"/>
91+
<ComponentRef Id="NpmPowerShellScript"/>
9192
<ComponentRef Id="NpxCmdScript"/>
9293
<ComponentRef Id="NpxBashScript"/>
94+
<ComponentRef Id="NpxPowerShellScript"/>
9395
<ComponentRef Id="NpmConfigurationFile"/>
9496
<ComponentRef Id="SetInstallDirPermission" />
9597
<ComponentGroupRef Id="NpmSourceFiles"/>
@@ -224,6 +226,10 @@
224226
<File Id="npm.sh" KeyPath="yes" Source="$(var.NpmSourceDir)\bin\npm"/>
225227
</Component>
226228

229+
<Component Id="NpmPowerShellScript">
230+
<File Id="npm.ps1" KeyPath="yes" Source="$(var.NpmSourceDir)\bin\npm.ps1"/>
231+
</Component>
232+
227233
<Component Id="NpxCmdScript">
228234
<File Id="npx.cmd" KeyPath="yes" Source="$(var.NpmSourceDir)\bin\npx.cmd"/>
229235
</Component>
@@ -232,6 +238,10 @@
232238
<File Id="npx.sh" KeyPath="yes" Source="$(var.NpmSourceDir)\bin\npx"/>
233239
</Component>
234240

241+
<Component Id="NpxPowerShellScript">
242+
<File Id="npx.ps1" KeyPath="yes" Source="$(var.NpmSourceDir)\bin\npx.ps1"/>
243+
</Component>
244+
235245
<Directory Id="NodeModulesFolder" Name="node_modules">
236246
<Directory Id="NpmFolder" Name="npm">
237247
<Component Id="NpmConfigurationFile">

vcbuild.bat

+4
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,10 @@ if not defined nonpm (
406406
if errorlevel 1 echo Cannot copy npx && goto package_error
407407
copy /Y ..\deps\npm\bin\npx.cmd %TARGET_NAME%\ > nul
408408
if errorlevel 1 echo Cannot copy npx.cmd && goto package_error
409+
copy /Y ..\deps\npm\bin\npm.ps1 %TARGET_NAME%\ > nul
410+
if errorlevel 1 echo Cannot copy npm.ps1 && goto package_error
411+
copy /Y ..\deps\npm\bin\npx.ps1 %TARGET_NAME%\ > nul
412+
if errorlevel 1 echo Cannot copy npx.ps1 && goto package_error
409413
)
410414

411415
if not defined nocorepack (

0 commit comments

Comments
 (0)