Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for process.env.npminstall_cache #471

Merged
merged 1 commit into from
Dec 18, 2023

Conversation

feichao93
Copy link
Contributor

@feichao93 feichao93 commented Dec 18, 2023

现状

npminstall 内置了 tarball 的缓存能力,默认的缓存地址为 ~/.npminstall_tarball. npminstall 不支持通过 --cache 配置缓存目录的位置,但支持通过 process.env.npm_config_cache 进行配置。

我们的预期

预期能通过配置文件或环境变量修改 npminstall 缓存的位置,且缓存的目录能与 npm 区分开

遇到的问题

如果使用 npm_config_cache 配置 npminstall 的缓存位置,会同时修改 npm 的缓存位置,导致两个缓存总是位于同一个父目录

修改方法

新增 process.env.npminstall_cache 配置,允许配置缓存位置,且能够和 npm 的缓存目录分隔开。 (或者其他方式,能满足需求即可)

@fengmk2 fengmk2 merged commit bd2cd34 into 6.x Dec 18, 2023
8 checks passed
@fengmk2 fengmk2 deleted the feat/support_env_npminstall_cache branch December 18, 2023 09:14
fengmk2 pushed a commit that referenced this pull request Dec 18, 2023
[skip ci]

## [6.8.0](v6.7.1...v6.8.0) (2023-12-18)

### Features

* add support for process.env.npminstall_cache ([#471](#471)) ([bd2cd34](bd2cd34))
fengmk2 pushed a commit that referenced this pull request Dec 18, 2023
[skip ci]

## [7.12.0](v7.11.1...v7.12.0) (2023-12-18)

### Features

* add support for process.env.npminstall_cache (cherry-pick [#471](#471)) ([#472](#472)) ([4c2cc3b](4c2cc3b))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants