Files
runner-images/images/win/scripts/Installers/Install-NodeLts.ps1
Maxim Lobanov 892ada55d5 [Windows] Docker, .NET Core and NPM improvements (#3811)
* 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
2021-08-01 15:10:59 +03:00

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"