Pick up npm config for alternative npm registries, custom ca, etc.
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 38/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript
调研方向
首先跟踪 ember-cli-update 和 boilerplate-update 如何调用 pacote,重点关注 downloadAndCheckForUpdates、getApplicableCodemods、getCodemods 和 getVersions。将提议的 npm-conf 方案与 pacote 的选项进行比较,然后定义一致的配置路径;完成标准是能够遵循备用 registry 和自定义 CA 证书,而无需分散地修改 opts。
由索引模型根据 Issue 内容生成。
描述
Unfortunately embrer-cli-update won't work in environments that rely on customising the npm registry.
I feel Ember is a good option for enterprises, which are often in this situation of using an internal mirror registry. It would be great to smooth the Ember upgrade experience by being able to use this tool.
Two issues here:
- using wrong registry
- not picking up custom CA certs
❯ ember-cli-update --to 4.12
FetchError: request to https://registry.npmjs.org/ember-cli failed, reason: self-signed certificate in certificate chain
at ClientRequest.<anonymous> (/<redacted global path>/node_modules/ember-cli-update/node_modules/minipass-fetch/lib/index.js:130:14)
at ClientRequest.emit (node:events:517:28)
at TLSSocket.socketErrorListener (node:_http_client:501:9)
at TLSSocket.emit (node:events:517:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
code: 'SELF_SIGNED_CERT_IN_CHAIN',
errno: 'SELF_SIGNED_CERT_IN_CHAIN',
type: 'system'
}
I assume the best way for this tool to work is that it is aware of npm config, however that is passed to npm. (env, flags, npmrc)
Hacky solution
I have cobbled together a solution that uses npm-conf to grab the npm configuration and pass it into the various pacote methods' opts param.
In boilerplate-update I also modified these functions to take an opts arg to pass to pacote:
downloadAndCheckForUpdates getApplicableCodemods getCodemods getVersions.
It sort of works, but doesn't feel like the most elegant design.
Considering something more ideal
It would be nice if pacote could be configured to pick up npm config out of the box.
Maybe, as an interim, pacote could be wrapped/proxied within boilerplate-update to pick up npm config when necessary. Expose that same proxy for ember-cli-update to make use of. This should require less changes to the various method signatures within ember-cli-update and boilerplate-update
Then there's npm-conf not npm official, and not well maintained, but has significant use.
To me, this still feels hacky, and really there should be some module npm relies on that we can also rely on for picking up npm config.
What do you reckon @kellyselden? Is there a better approach you're aware of?
- 主要语言
- JavaScript
- 星标
- 279
- 派生
- 44
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ember-cli/ember-cli-update 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 25/100
ember-cli/ember-cli-update#1263 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 25/100
ember-cli/ember-cli-update#1256 · 1 条评论 ·
-
难度 5/5 一周以上 新手友好度 25/100
ember-cli/ember-cli-update#1255 ·
-
难度 3/5 1-2 天 新手友好度 35/100
ember-cli/ember-cli-update#1254 ·
-
难度 4/5 3-5 天 新手友好度 25/100
ember-cli/ember-cli-update#1218 · 2 条评论 ·
查看 ember-cli/ember-cli-update 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 2/5 1-3 小时 新手友好度 74/100
solana-foundation/solana-com#2202 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 92/100
yegor256/copyrights-action#216 ·
-
[BUG] onScroll never refreshes the window container's height after a vertical-only viewport resize未关闭
难度 2/5 1-3 小时 新手友好度 88/100
juliangarnier/anime#1192 ·
-
难度 2/5 1-3 小时 新手友好度 84/100
PedestrianDynamics/pyFDS-Evac#226 ·
维护者通常 1 天内回复