Metro is the JavaScript bundler for React Native, currently at v0.84.3. It is maintained by Meta and releases follow a regular cadence aligned with React Native releases. Metro focuses on sub-second reload cycles, fast startup, and handling thousands of modules. It is deeply integrated with React Native's development workflow, providing Fast Refresh, HMR, and a symmetric asset system. Compared to alternatives like Webpack, Metro is purpose-built for React Native, offering out-of-the-box support for React Native's module system, asset loading, and platform-specific code. It is configurable via metro.config.js and supports both CommonJS and ES modules.
npm install metro-bundlerVerified import paths — ran on the pinned version, not inferred.
Starts a Metro bundler server with custom Express integration.
Upgrade to Node v20.19 or later, or pin Metro to v0.83.x
Upgrade your project's Babel to v7
Rename to `metro.config.mjs` or move to `.config/metro.js`
Upgrade to v0.83.4+ or configure keepalive manually
Update code to handle asset objects, e.g., asset.uri
Ensure Babel configuration includes @babel/plugin-transform-modules-commonjs
Run `npm install react-native` and ensure metro.config.js has proper watchFolders
Add `@babel/preset-env` or `@babel/plugin-transform-modules-commonjs` to Babel config
Use `import { loadConfig } from 'metro'` instead of 'metro-config'Kill the process using port 8081 or set a different port in metro.config.js