`npm config get cache` fails with `EBADDEVENGINES` when requiring newer npm versions in `devEngines`
I maintainer di solito rispondono entro 4 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 52/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- node.js, typescript
Direzione di ricerca
Inizia tracciando il percorso della cache del package manager di setup-node e l'invocazione npm config get cache rispetto alla configurazione devEngines di package.json segnalata. Riproduci il problema con Node.js 22 e npm 10, quindi verifica che setup-node venga completato e consenta l'installazione della versione richiesta di npm prima di configurare la cache.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description: setup-node fails immediately if the initial npm version doesn't satisfy devEngines.packageManager.version
If a package requires a specific version of Node.js and a specific version of npm, but the built-in npm version is different than the package's required npm version, setup-node fails immediately (at npm config get cache) with EBADDEVENGINES, before there is a chance to install a different version of npm
For example, if my package requires Node.js v22.x and npm v11.10+, npm config get cache fails because Node.js v22 ships with npm v10
Action version: v6.4.0
Platform:
- Ubuntu
- macOS
- Windows
Runner type:
- Hosted
- Self-hosted
Tools version:
- Node.js: 22.22.2
- npm: 10.9.7
Repro steps:
-
Configure
package.json{ "engines": { "node": "^22" }, "devEngines": { "packageManager": { "name": "npm", "version": "^11.10.0" } } } -
Call setup-node
jobs: setup-node: runs-on: 'ubuntu-latest' steps: - uses: actions/[email protected] # fails - uses: actions/[email protected] with: node-version-file: package.json # never runs - run: npm --global install npm@^11.10.0 -
setup-node fails
Run actions/[email protected] with: node-version-file: package.json check-latest: false token: *** package-manager-cache: true Resolved package.json as ^22 Found in cache @ /opt/hostedtoolcache/node/22.22.2/x64 Environment details node: v22.22.2 npm: 10.9.7 yarn: 1.22.22 Detected npm as the package manager from package.json's packageManager field. Auto caching has been enabled for npm. If you want to disable it, set package-manager-cache input to false /opt/hostedtoolcache/node/22.22.2/x64/bin/npm config get cache npm error code EBADDEVENGINES npm error EBADDEVENGINES The developer of this package has specified the following through devEngines npm error EBADDEVENGINES Invalid devEngines.packageManager npm error EBADDEVENGINES Invalid semver version "^11.10.0" does not match "10.9.7" for "packageManager" npm error EBADDEVENGINES { npm error EBADDEVENGINES current: { name: 'npm', version: '10.9.7' }, npm error EBADDEVENGINES required: { name: 'npm', version: '^11.10.0' } npm error EBADDEVENGINES }
Expected behavior:
I expect setup-node to succeed so that I can immediately install a version of npm required by my project
Actual behavior:
setup-node fails before I can install a version of npm required by my project
My use case:
My app requires Node.js v22, so I declare that in package.json.engines:
{
"engines": {
"node": "^22"
}
}
I want to enforce min-release-age, so I add it to .npmrc:
min-release-age = 1
min-release-age was added in npm v11.10.0, so I require npm v11.10+ in package.json.devEngines:
{
"devEngines": {
"packageManager": {
"name": "npm",
"version": "^11.10.0"
}
}
}
This is basically the same as #1410, but #1410 was closed with a workaround that only works in certain situations. I created this issue to explain my use case, and my project's constraints, which I think should be pretty standard: require the Maintenance LTS version of Node.js and a newer minimum version of npm
#1410 was closed with this workaround:
The reliable workaround is to specify a Node version in setup-node that already includes the npm version your devEngines.packageManager requires. This ensures the npm version matches your project’s requirements from the start.
This is only possible if your Node.js version is flexible and happens to ship with an npm version that satisfies the project's requirements
Related: #529
- Lingua principale
- TypeScript
- Stelle
- 5k
- Fork
- 1.7k
- Merge medio
- 4g 22h
- PR unite (30g)
- 5
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
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 actions/setup-node
-
feature request
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
actions/setup-node#1531 · 1 commento · 4 reazioni ·
I maintainer di solito rispondono entro 4 giorni
-
feature request
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
actions/setup-node#1634 · 1 commento ·
I maintainer di solito rispondono entro 4 giorni
-
Volta extends resolution in getNodeVersionFromFile has no cycle detection, recursing until stack overflowForse già presa @v-gowridurgad l’ha presa 24 giorni fa. Apertabug
actions/setup-node#1628 · 3 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 4 giorni
-
feature request
Difficoltà 3/5 1-2 giorni Idoneità per principianti 38/100
actions/setup-node#1428 · 1 commento · 3 reazioni ·
I maintainer di solito rispondono entro 4 giorni
-
feature request
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
actions/setup-node#1422 · 4 commenti ·
I maintainer di solito rispondono entro 4 giorni
Tutte le issue di actions/setup-node
Issue simili
-
fix(data-lake): wizard source step still previews the local slug, not the server-disambiguated oneApertadata-lake
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue priority: low size: XS
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Empty label or headline exports the editor hint ("LABEL" / "Headline goes here") into the PNGAperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
-
Spray wall wizard: Done button on the hold review step sits under the navigation header (iOS)Apertabug ios mobile priority:P1
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
streamplace/streamplace#1351 ·
I maintainer di solito rispondono entro 2 giorni