Switch automatically
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 30/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- nodejs, typescript
调研方向
首先阅读 Corepack 当前处理项目元数据和版本选择的方式,然后调查 devEngines 的表示方式,以及在执行 cd 时进行切换是否属于 Corepack 的范围。所请求的行为是在 npm i 之前自动选择 Node 和 npm;完成的标准是提供一个有文档说明且受支持的工作流,在完成初始设置后无需针对每个 repository 执行任何步骤。
由索引模型根据 Issue 内容生成。
描述
Is there any way to make it so when I clone down a brand new repo that uses devEngines and cd into it, I'm automatically on the correct Node/npm version, via corepack. Example:
{
"name": "my-project",
"devEngines": {
"runtime": {
"name": "node",
"version": ">= 24.0.0"
},
"packageManager": {
"name": "npm",
"version": "11.7.0"
}
}
}
I'm fine with a one time series of steps to install corepack and enable it or whatever, but I don't want to have to do any steps at all after that. I should be able to just git clone https://github.com/org/my-project.git && cd my-project && npm i && npm start and know that if that project uses a different version of Node or npm from what I have it will download it automatically and switch to it before doing the npm i.
This is fully possible with Volta (not with devEngines object, but a similar volta object in the package.json). But Volta is no longer maintained. Can Corepack be used as a replacement today, or would it be possible for it to add support for these features? Thanks.
- 主要语言
- TypeScript
- 星标
- 3.8k
- 派生
- 279
- 平均合并
- 1 小时 47 分钟
- 30 天内合并 PR
- 2
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
nodejs/corepack 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 64/100
-
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 4/5 3-5 天 新手友好度 68/100
-
难度 3/5 1-2 天 新手友好度 52/100
-
难度 3/5 1-2 天 新手友好度 68/100
相似的 Issue
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 1/5 1 小时以内 新手友好度 85/100
-
Mend: dependency security vulnerability untriaged
难度 2/5 1-3 小时 新手友好度 70/100