Skip to content

Commit ca6c9a0

Browse files
committed
Tweak installNode
1 parent bc3e00b commit ca6c9a0

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

eng/helix/content/InstallNode.ps1

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ if (Get-Command "node.exe" -ErrorAction SilentlyContinue)
2525
exit
2626
}
2727

28-
if (Test-Path "$InstallDir\node.exe")
28+
if (Test-Path ".\nodejs\node.exe")
2929
{
30-
Write-Host "Node.exe found at $InstallDir"
30+
Write-Host "Node.exe found at .\nodejs\node.exe"
3131
exit
3232
}
3333

@@ -53,10 +53,8 @@ else {
5353
[System.IO.Compression.ZipFile]::ExtractToDirectory("nodejs.zip", $tempDir)
5454
}
5555

56-
Write-Host "Expanded NodeJs"
57-
New-Item -Path "$InstallDir" -ItemType "directory" -Force
58-
Write-Host "Copying $tempDir\$nodeFile\* to $InstallDir"
59-
Copy-Item "$tempDir\$nodeFile\*" "$InstallDir" -Recurse
56+
Write-Host "Expanded NodeJs to $tempDir, moving $tempDir\$nodeFile to .\nodejs subdir"
57+
move $tempDir\$nodeFile nodejs
6058
if (Test-Path "$InstallDir\node.exe")
6159
{
6260
Write-Host "Node.exe copied to $InstallDir"
@@ -67,7 +65,7 @@ else
6765
}
6866
if (Test-Path "package-lock.json")
6967
{
70-
$Env:Path += ";" + $Env:HELIX_CORRELATION_PAYLOAD + "\jdk\bin;" + $Env:CD
68+
$Env:Path += ";" + $Env:HELIX_CORRELATION_PAYLOAD + "\jdk\bin;" + $Env:CD + "\nodejs"
7169
Write-Host "Found package-lock.json, running $InstallDir\npm install"
7270
Invoke-Expression "$InstallDir\npm.cmd install"
7371
}

0 commit comments

Comments
 (0)