From 984ffb2dceb6cee9c16c9191e6a4f4cc50dd5ed8 Mon Sep 17 00:00:00 2001 From: Roman Lavrov Date: Mon, 22 Sep 2025 19:35:11 -0400 Subject: [PATCH] Workaround npm.ps1 interaction with & & npm does not work on newer Node.js releases due to the way npm.ps1 (which this resolves to) parses the command line --- src/windows/Install-DashcamCLI.ps1 | 2 +- src/windows/Install-NodeJS.ps1 | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/windows/Install-DashcamCLI.ps1 b/src/windows/Install-DashcamCLI.ps1 index 5397252..423a9e0 100644 --- a/src/windows/Install-DashcamCLI.ps1 +++ b/src/windows/Install-DashcamCLI.ps1 @@ -9,7 +9,7 @@ Set-StrictMode -Version Latest Write-Host "Installing Dashcam CLI $Version..." -& npm install --location=global dashcam@$Version +cmd /c npm install --location=global dashcam@$Version Write-Host "Verifying Dashcam CLI Install..." & dashcam --help diff --git a/src/windows/Install-NodeJS.ps1 b/src/windows/Install-NodeJS.ps1 index d469496..4d6c9fb 100644 --- a/src/windows/Install-NodeJS.ps1 +++ b/src/windows/Install-NodeJS.ps1 @@ -42,10 +42,10 @@ Write-Host "Installing Node.js $Version..." # For the moment, use 16 as that matches the major version of $Version, but # eventually make this include the value of $Version in some way $env:PATH = "$Directory;$env:PATH" -& npm config set prefix $Directory +cmd /c npm config set prefix $Directory Write-Host "NPM configuration, local" -& npm config list +cmd /c npm config list Write-Host "NPM configuration, global" -& npm config list -g +cmd /c npm config list -g