If you've ever worked with Expo Application Services (EAS) and seen the warning:
★ eas-cli@16.28.0 is now available. To upgrade, run npm install -g eas-cli. Proceeding with outdated version.
...only to run the upgrade, open the same terminal, and see the exact same warning, you've run into a classic developer environment gotcha!
This article explains why this happens and why the simple fix—running npx eas-cli build—solves the problem instantly.
The Problem: When eas build Fails
The user's initial build failed with a dependency error:
The 'expo-modules-autolinking' package has been found, but it seems to be incompatible with '@expo/prebuild-config'
Error: build command failed.
This incompatibility often requires the latest version of eas-cli to resolve the project's dependencies correctly. The user ran the correct upgrade command:
npm install -g eas-cli
But when they tried to build again, the CLI still warned them it was outdated:
cathy@Cathys-MacBook-Air-2 workout_app % eas build --platform ios --profile development
★ eas-cli@16.28.0 is now available.
To upgrade, run npm install -g eas-cli.
Proceeding with outdated version.
This loop is confusing! The tool is updated, but the command is still using the old version. Why?
The Root Cause: The Terminal's PATH Cache
When you type a command like eas build, your shell (e.g., zsh or bash) doesn't know where the eas executable file is located. It searches through a list of directories defined in an environment variable called $PATH.
- Old
easLocation: The first time you installedeas-cliglobally, the shell found it at a specific path (e.g.,/usr/local/bin/eas). - Shell Caching: For speed, your terminal often caches (remembers) the location of commands you've used in the current session.
- The Upgrade: When you run
npm install -g eas-cli, the new binary is installed, often in the same location. - The Conflict: However, the currently open terminal session is still using its cached knowledge of the old
easexecutable. It's pointing to the outdated version's location, even though the file itself has been overwritten or the system needs to refresh the path.
This is why, as a common troubleshooting step, simply closing and reopening the terminal usually solves the problem! It forces the shell to clear its cache and re-scan the $PATH.
The Elegant Solution: Using npx
Instead of messing with caches or relaunching terminals, we have a modern Node.js tool that acts as a reliable shortcut: npx.
The fix that worked:
npx eas-cli build --platform ios --profile development
How npx Saves the Day
-
Bypassing the PATH:
npx(Node Package Execute) is designed to execute Node.js package executables. Crucially, it does not rely on your shell's cached PATH. -
Intelligent Resolution: When you run
npx eas-cli ..., it first checks your project's localnode_modulesfor the binary. If it doesn't find it (which is true for globally installed tools likeeas-cli), it immediately executes the latest globally installed version, ignoring any stale cache in your current shell session.
By using npx, you guarantee that you are executing the newest version of the tool available on your system, bypassing all the headaches of shell caching and environment variables.
Key Takeaways for Developers
If a global tool update doesn't seem to take effect:
- The Simple Fix: Close and reopen your terminal.
- The Reliable Fix: Use
npxbefore the command (e.g.,npx <tool-name>).
Keep coding, and happy building! 🚀
Top comments (0)