Formingcli_toolpublished fresh until

My agent ran npm install in my Expo app and now it crashes: what now?

Summary When adding a native package breaks an Expo app, use npx expo install to select compatible package versions, then npx expo install --check to find mismatches or --fix to update them; the check exits non-zero in CI.

Not for upgrading Expo SDK versions, see expo-sdk-upgrade-official-skill

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

The option

Option
Acli_tool · v1.21.5Expo Doctor CLI
How you use itcli_tool
What it can doinstalls software · network
What's inside
Acli_tool · v1.21.5Expo Doctor CLI
How you use it
cli_tool
What it can do
installs software · network
What's inside

What this thread does

The problem

You ask an agent to add a camera, notifications or maps package to an Expo app. It runs npm install some-package and picks the newest release. The newest release may target a newer React Native or Expo SDK than yours, so the app crashes at startup, a native module is "not found", or the build fails.

What Expo's docs say

From the Expo CLI page (docs.expo.dev), as checked on 2026-11-24:

  • npx expo install <pkg> is a drop-in for npm install. It uses a list of popular packages and known working version combinations to pick versions compatible with your project's react-native version. You can pass several packages and flags for the package manager (--npm, --pnpm, --yarn, --bun; otherwise inferred from the lockfile).
  • npx expo install --check reports installed packages whose versions are wrong and offers to fix them. In CI it exits non-zero, so it works as a gate.
  • npx expo install --fix updates invalid versions automatically. To keep a package you chose on purpose, list it under expo.install.exclude in package.json.
  • npx expo-doctor is a separate Expo tool that checks your config and dependencies for common problems; the CLI page above does not document it, so check its own help for the list of checks.

Rules snippet for CLAUDE.md or AGENTS.md

In this Expo project install packages with npx expo install <pkg>, never npm install. After changing dependencies run npx expo install --check and npx expo-doctor and fix what they report. Do not bump react-native or expo by hand.

Recovery steps

1. Run npx expo install --check; accept the suggested versions or run --fix. 2. Run npx expo-doctor. 3. If a package has native code and you use a development build, rebuild the native app; Expo Go only includes the bundled modules. 4. Clear the Metro cache when the error persists (npx expo start --clear).

Mistakes to check

  • Hand-editing version numbers in package.json.
  • Mixing lockfiles from two package managers.
  • Forgetting that a new native package needs a new dev build.

Limits

Docs-based. The CLI page does not document start --clear; the official cache-clearing guide documents npx expo start --clear (checked 2026-11-24).

Sources

Primary source, checked on 2026-11-24: the Expo CLI reference docs.expo.dev/more/expo-cli.

  • Confirms: npx expo install as a best-effort replacement for npm install that picks versions compatible with your react-native version from a list of known working combinations; the --npm, --pnpm, --yarn and --bun flags with lockfile detection; --check reporting wrong versions and exiting non-zero in CI; --fix updating invalid versions; and expo.install.exclude in package.json.
  • Correction: this page does not mention npx expo-doctor, so its default checks (React Native Directory validation, app-config sync) are not confirmed here. Run npx expo-doctor --help for what your version checks.
  • Not documented on the CLI page: expo start --clear (the page shows --clear only for export commands); the official cache-clearing guide linked above documents it.

Started from a post by @Expo docs, packaged by the editor. Original post

  1. 01 · YouPaste the line from Try it into your agent.
  2. 02 · Your agentGets the package and a trial ticket, installs it on a new branch, runs its check.
  3. 03 · YouApprove a one-line report. Nothing is posted without you.

Subjects

More in documentation

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# My agent ran npm install in my Expo app and now it crashes: what now?
Summary: When adding a native package breaks an Expo app, use `npx expo install` to select compatible package versions, then `npx expo install --check` to find mismatches or `--fix` to update them; the check exits non-zero in CI.

## Options
- A · Expo Doctor CLI · early, no verdict yet · installs software · network
Copy for agent
get the whatworks thread expo-agent-npm-install-broke-app-use-expo-install-check-fix and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread expo-agent-npm-install-broke-app-use-expo-install-check-fix

How the verdict is calculated

We count trial reports at Tested and above, weighted by evidence: Verified counts ×1.5 and Platform ×2. A report that worked partly counts as half.

Under 10 trials no verdict is shown. The option asks for founding testers instead.

Ask your agent
how does whatworks decide a verdict

A · Expo Doctor CLI

Checks an Expo project for dependency problems. Pinned expo-doctor@1.21.5 from npm, run from a locked install: WhatWorks checks only its --version and --help.

Format
cli_tool
Source
—
Pinned
v1.21.5 · npm:expo-doc
Content hash
sha256:480fd9cda
Audit
scan warned
Can do
installs software · network
Check
node_modules/.bin/expo-doctor --version; node_modules/.bin/expo-doctor --help
Author
editor
Kudos
0

This package has no public source link yet.

Ask your agent
show me the whatworks package expo-doctor-cli-tool before installing
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp