fix(with-e2e): fresh npm install fails with an e2e peer dependency conflict

Aperta Adatta ai principianti
#717 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
66/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
nodejs, react-native

Direzione di ricerca

Inizia dal blocco devDependencies in with-e2e/package.json (righe 23-32), dove gli intervalli di e2e e @e2e-dev/mobile sono in conflitto. Riproduci eseguendo npm install in una copia nuova senza lockfile per vedere l'errore ERESOLVE. È completato quando l'installazione riesce senza --force o --legacy-peer-deps e la versione risolta di e2e soddisfa l'intervallo di peer dell'adattatore mobile.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

A fresh with-e2e example cannot install its JavaScript dependencies with npm. Its e2e core range and the mobile adapter selected by its tilde range have incompatible peer requirements, so the documented setup stops before the app or tests can run.

Runtime or environment

  • Example: current master, commit 2cc7a440b01eb30e326b91cf1f3aae41e749d128, with no lockfile in with-e2e/.
  • Platform: macOS on Apple silicon; Node.js 26.12.1; npm 12.2.1 and 12.2.2 (latest published npm, with the same failure).
  • Documented scaffolding path: create-expo 5.1.7, the latest published release checked.
  • Example ranges: e2e ~0.21.3, @e2e-dev/mobile ~0.12.4, @e2e-dev/eas ~0.3.2, and @e2e-dev/web ~0.15.3.
  • Resolved mobile adapter: @e2e-dev/mobile 0.12.6; its published e2e peer range is >=0.22.1 <1. The preceding mobile patch, 0.12.5, declares >=0.15.0 <1.
  • Verified workaround set: e2e 0.23.0, eas 0.3.3, mobile 0.12.6, and web 0.15.5, selected by e2e upgrade.

Steps to reproduce

Using the supported Node runtime above, either follow the README's scaffolding path:

npx -y create-expo@latest example-app --example with-e2e --yes

or install an untouched copy of the example directly:

git clone --depth 1 https://github.com/expo/examples.git
cp -R examples/with-e2e example-copy
cd example-copy
npm install

Both paths were executed. No Expo login, native build, hosted simulator session, or workflow is needed to reach the error.

Expected behavior

The example's documented setup should install a mutually compatible dependency set without bypassing npm's peer dependency checks.

Actual behavior

The direct npm install exits 1 with:

npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error While resolving: [email protected]
npm error Found: [email protected]
npm error   dev e2e@"~0.21.3" from the root project
npm error Could not resolve dependency:
npm error peer e2e@">=0.22.1 <1" from @e2e-dev/[email protected]
npm error   dev @e2e-dev/mobile@"~0.12.4" from the root project

The scaffold downloads the example but its npm install fails with the same conflict. create-expo then prints that JavaScript dependency installation failed and continues creating the project; the scaffold command itself exits 0, leaving dependencies uninstalled.

In a disposable copy, E2E_TELEMETRY_DISABLED=1 npx -y e2e@latest upgrade updated the e2e packages to the workaround set above and its npm install completed successfully. This verified dependency installation only; no application build or test run was performed for this report.

Evidence

  • Expected source: The example's How to use instructions offer the scaffolding command as its setup path.
  • Failure source: The two executed setup paths above, with the npm error excerpt retained inline; the example's devDependencies define the incompatible ranges.
  • Evidence provenance: observed
  • Local verification: reproduced
  • Reproduction completeness: complete

The peer-range difference can be checked without installing the example:

npm view @e2e-dev/[email protected] peerDependencies
npm view @e2e-dev/[email protected] peerDependencies

This report concerns the example's installable dependency set. The adapter's peer-range change is context, rather than a request to change the adapter's compatibility contract here.

Restoration check

From a fresh copy with no lockfile or node_modules, both the direct npm install and the README's scaffolding path should install successfully on a supported Node runtime, with peer dependency checks enabled and no --force or --legacy-peer-deps override. Confirm that the resolved e2e packages agree on their peer requirements.

Triage assessment

  • Impact level: P2
  • Assessment status: supported
  • Impact basis: Fresh users of this specific example cannot complete dependency installation through either tested setup path; other examples were not assessed.
  • Workaround status: available
  • Workaround basis: Running the released e2e upgrade command in a disposable copy selected a compatible package set and completed npm installation without disabling peer checks.
Lingua principale
TypeScript
Stelle
3.8k
Fork
1.1k
Merge medio
1g 14h
PR unite (30g)
1

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di expo/examples

Tutte le issue di expo/examples

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.