Commit bd2cd34
authored
feat: add support for process.env.npminstall_cache (#471)
### 现状
npminstall 内置了 tarball 的缓存能力,默认的缓存地址为 `~/.npminstall_tarball`.
npminstall 不支持通过 `--cache` 配置缓存目录的位置,但支持通过
`process.env.npm_config_cache` 进行配置。
### 我们的预期
预期能通过配置文件或环境变量修改 npminstall 缓存的位置,且缓存的目录能与 npm 区分开
### 遇到的问题
如果使用 `npm_config_cache` 配置 npminstall 的缓存位置,会同时修改 npm
的缓存位置,导致两个缓存总是位于同一个父目录
### 修改方法
新增 `process.env.npminstall_cache` 配置,允许配置缓存位置,且能够和 npm 的缓存目录分隔开。
(或者其他方式,能满足需求即可)1 parent 13b20e9 commit bd2cd34
2 files changed
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
199 | 202 | | |
200 | 203 | | |
201 | 204 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
62 | 75 | | |
0 commit comments