Pick up npm config for alternative npm registries, custom ca, etc.
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 38/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- javascript
Direzione di ricerca
Inizia tracciando il modo in cui ember-cli-update e boilerplate-update chiamano pacote, concentrandoti su downloadAndCheckForUpdates, getApplicableCodemods, getCodemods e getVersions. Confronta l’approccio npm-conf proposto con le opzioni di pacote, quindi definisci un percorso di configurazione coerente; il lavoro sarà completato quando verranno rispettati i registry alternativi e i certificati CA personalizzati senza richiedere modifiche sparse a opts.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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?
- Lingua principale
- JavaScript
- Stelle
- 279
- Fork
- 44
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ember-cli/ember-cli-update
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
ember-cli/ember-cli-update#1263 · 1 commento ·
-
Codemods are all failing Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
ember-cli/ember-cli-update#1256 · 1 commento ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
ember-cli/ember-cli-update#1255 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
ember-cli/ember-cli-update#1254 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
ember-cli/ember-cli-update#1218 · 2 commenti ·
Tutte le issue di ember-cli/ember-cli-update
Issue simili
-
status: waiting triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
freeCodeCamp/freeCodeCamp#70412 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
Jason-Vaughan/TangleClaw#1884 ·
-
bug good first issue web
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
microsoft/TypeScript#64453 ·
-
self-driving
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100