expo/expo · error · Error

Not a valid project directory (no package.json): ${resolvedD

Error message

Not a valid project directory (no package.json): ${resolvedDir}

What it means

Error "Not a valid project directory (no package.json): ${resolvedDir}" thrown in expo/expo.

Source

Thrown at apps/expo-go/scripts/download-snack-runtime.js:131

function formatSize(bytes) {
  if (bytes < 1024) return `${bytes} B`;
  if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
  return `${(bytes / 1024 / 1024).toFixed(2)} MB`;
}

// ---------------------------------------------------------------------------
// Local build: export from a local snack runtime directory
// ---------------------------------------------------------------------------

async function buildLocalSnackRuntime(runtimeDir) {
  const resolvedDir = path.resolve(runtimeDir);

  if (!fs.existsSync(resolvedDir)) {
    throw new Error(`Directory does not exist: ${resolvedDir}`);
  }
  if (!fs.existsSync(path.join(resolvedDir, 'package.json'))) {
    throw new Error(`Not a valid project directory (no package.json): ${resolvedDir}`);
  }

  const exportDir = path.join(resolvedDir, '.expo-go-export');

  // 1. Install dependencies
  console.log(`Installing dependencies in ${resolvedDir}...`);
  execSync('yarn install', { cwd: resolvedDir, stdio: 'inherit' });

  // 2. Export the iOS bundle
  console.log(`\nExporting iOS bundle...`);
  execSync(`npx expo export --platform ios --output-dir "${exportDir}"`, {
    cwd: resolvedDir,
    stdio: 'inherit',
    env: { ...process.env, EXPO_PUBLIC_SNACK_ENV: 'production' },
  });

  // 3. Find the .hbc bundle
  const jsDir = path.join(exportDir, '_expo/static/js/ios');

View on GitHub (pinned to b09195aac2)

When it happens

Trigger: Thrown at apps/expo-go/scripts/download-snack-runtime.js:131 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of expo/expo@b09195aac2 (2026-08-12). Data as JSON: /api/errors/859a56ad008178e4. Report an issue: GitHub.