diff --git a/build/tfs/win32/lib.ps1 b/build/tfs/win32/lib.ps1 index 610b4d7fcdf..ed8407b7013 100644 --- a/build/tfs/win32/lib.ps1 +++ b/build/tfs/win32/lib.ps1 @@ -1,8 +1,11 @@ # stop when there's an error $ErrorActionPreference = 'Stop' -# set agent specific npm cache if (Test-Path env:AGENT_WORKFOLDER) { + # will be used by node-gyp + $env:HOME = "${env:AGENT_WORKFOLDER}\home" + + # will be used by npm $env:npm_config_cache = "${env:AGENT_WORKFOLDER}\npm-cache" } diff --git a/scripts/env.ps1 b/scripts/env.ps1 index 3d34630f391..f05a5680644 100644 --- a/scripts/env.ps1 +++ b/scripts/env.ps1 @@ -1,5 +1,5 @@ $env:npm_config_disturl="https://atom.io/download/electron" $env:npm_config_target=(node -p "require('./package.json').electronVersion") $env:npm_config_runtime="electron" -$env:npm_config_cache="$HOME/.npm-electron" +$env:npm_config_cache="${env:USERPROFILE}/.npm-electron" New-Item -Path "$env:npm_config_cache" -Type directory -Force | out-null \ No newline at end of file