[Windows] Rework NodeJS install (#4375)

This commit is contained in:
Nikolay Frolov
2021-10-30 14:03:05 +03:00
committed by GitHub
parent 64b553b5d0
commit 234919982e
5 changed files with 17 additions and 1 deletions

View File

@@ -10,7 +10,8 @@ $CachePath = 'C:\npm\cache'
New-Item -Path $PrefixPath -Force -ItemType Directory New-Item -Path $PrefixPath -Force -ItemType Directory
New-Item -Path $CachePath -Force -ItemType Directory New-Item -Path $CachePath -Force -ItemType Directory
Choco-Install -PackageName nodejs-lts -ArgumentList "--force" $defaultVersion = (Get-ToolsetContent).node.default
Choco-Install -PackageName nodejs -ArgumentList "--version=$defaultVersion"
Add-MachinePathItem $PrefixPath Add-MachinePathItem $PrefixPath
$env:Path = Get-MachinePath $env:Path = Get-MachinePath

View File

@@ -16,4 +16,10 @@ Describe "Node.JS" {
$Test | Should -ReturnZeroExitCode $Test | Should -ReturnZeroExitCode
} }
} }
Context "Node.js version" {
It "Node.js version should correspond to the version in the toolset" {
node --version | Should -BeLike "v$((Get-ToolsetContent).node.default)*"
}
}
} }

View File

@@ -421,5 +421,8 @@
"args": [ "--installargs", "ADD_CMAKE_TO_PATH=\"System\"" ] "args": [ "--installargs", "ADD_CMAKE_TO_PATH=\"System\"" ]
} }
] ]
},
"node": {
"default": "14.18.1"
} }
} }

View File

@@ -452,5 +452,8 @@
"args": [ "--installargs", "ADD_CMAKE_TO_PATH=\"System\"" ] "args": [ "--installargs", "ADD_CMAKE_TO_PATH=\"System\"" ]
} }
] ]
},
"node": {
"default": "14.18.1"
} }
} }

View File

@@ -289,5 +289,8 @@
"args": [ "--installargs", "ADD_CMAKE_TO_PATH=\"System\"" ] "args": [ "--installargs", "ADD_CMAKE_TO_PATH=\"System\"" ]
} }
] ]
},
"node": {
"default": "14.18.1"
} }
} }