mirror of
https://github.com/actions/runner-images.git
synced 2025-12-20 06:35:47 +00:00
* improve InitializeVM script * Update windows2019.json * remove configs * resolve comments * resolve comments; fix order * fix templates * move Node.js packages to toolset * dotnet warmup and merge docker scripts * Update Node.Tests.ps1 * Update Install-Docker.ps1 * fix node.js tests * fix npm package installation * Update Install-NodeLts.ps1 * fix tests * fix test
30 lines
927 B
PowerShell
30 lines
927 B
PowerShell
################################################################################
|
|
## File: Install-NodeLts.ps1
|
|
## Desc: Install nodejs-lts and other common node tools.
|
|
## Must run after python is configured
|
|
################################################################################
|
|
|
|
$PrefixPath = 'C:\npm\prefix'
|
|
$CachePath = 'C:\npm\cache'
|
|
|
|
New-Item -Path $PrefixPath -Force -ItemType Directory
|
|
New-Item -Path $CachePath -Force -ItemType Directory
|
|
|
|
Choco-Install -PackageName nodejs-lts -ArgumentList "--force"
|
|
|
|
Add-MachinePathItem $PrefixPath
|
|
$env:Path = Get-MachinePath
|
|
|
|
setx npm_config_prefix $PrefixPath /M
|
|
$env:npm_config_prefix = $PrefixPath
|
|
|
|
npm config set cache $CachePath --global
|
|
npm config set registry https://registry.npmjs.org/
|
|
|
|
$globalNpmPackages = (Get-ToolsetContent).npm.global_packages
|
|
$globalNpmPackages | ForEach-Object {
|
|
npm install -g $_.name
|
|
}
|
|
|
|
Invoke-PesterTests -TestFile "Node"
|