Android Bundling failed in expo-cli when we run "npm start" or scan expo app in mobile

Building JavaScript bundle: error
Unable to resolve module expo-constants from C:\Users\HP\Desktop\React Native\HelloApp\node_modules\expo-asset\build\LocalAssets.js: expo-constants could not be found within the project or in these directories:
> 1 | import Constants from 'expo-constants';
    |                        ^
  2 | import * as FileSystem from 'expo-file-system';
  3 | import { getLocalAssets } from './PlatformUtils';
  4 | // Fast lookup check if assets are available in the local bundle in managed apps

>Solution :

Is it safe to assume you have run: expo install expo-constants?

If not, do that, and rebuild.

If this is not solving your error try:

  • Deleting package-lock and node modules
  • rerun npm install

If neither of the above solutions work, please provide more information.

Edit: Constants documentation.

Leave a Reply