mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
[Windows] use npm config instead of npm_config_cache (#2153)
The `npm_config_cache` env, if set, will have highest priority, and harder to change. One way to un-set this is add a global workflow env, like: ``` env: npm_config_cache: '' ``` This commit change the cache config to use `npm config set cache $CachePath --global`, which should save the path under the global npmrc at: `C:\npm\prefix\etc\npmrc`, and allow easier later reset with user/repo level `.npmrc` files. For the record, my usage is to unify all platform's npm cache to `~/.npm/`, then use the same cache action config on all platform to cache the folder.
This commit is contained in:
@@ -18,9 +18,7 @@ $env:Path = Get-MachinePath
|
|||||||
setx npm_config_prefix $PrefixPath /M
|
setx npm_config_prefix $PrefixPath /M
|
||||||
$env:npm_config_prefix = $PrefixPath
|
$env:npm_config_prefix = $PrefixPath
|
||||||
|
|
||||||
setx npm_config_cache $CachePath /M
|
npm config set cache $CachePath --global
|
||||||
$env:npm_config_cache = $CachePath
|
|
||||||
|
|
||||||
npm config set registry http://registry.npmjs.org/
|
npm config set registry http://registry.npmjs.org/
|
||||||
|
|
||||||
npm install -g cordova
|
npm install -g cordova
|
||||||
|
|||||||
Reference in New Issue
Block a user