{"record":{"id":"859a56ad008178e4","repo":"expo/expo","slug":"not-a-valid-project-directory-no-package-json","errorCode":null,"errorMessage":"Not a valid project directory (no package.json): ${resolvedDir}","messagePattern":"Not a valid project directory \\(no package\\.json\\): (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/expo-go/scripts/download-snack-runtime.js","lineNumber":131,"sourceCode":"\nfunction formatSize(bytes) {\n  if (bytes < 1024) return `${bytes} B`;\n  if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;\n  return `${(bytes / 1024 / 1024).toFixed(2)} MB`;\n}\n\n// ---------------------------------------------------------------------------\n// Local build: export from a local snack runtime directory\n// ---------------------------------------------------------------------------\n\nasync function buildLocalSnackRuntime(runtimeDir) {\n  const resolvedDir = path.resolve(runtimeDir);\n\n  if (!fs.existsSync(resolvedDir)) {\n    throw new Error(`Directory does not exist: ${resolvedDir}`);\n  }\n  if (!fs.existsSync(path.join(resolvedDir, 'package.json'))) {\n    throw new Error(`Not a valid project directory (no package.json): ${resolvedDir}`);\n  }\n\n  const exportDir = path.join(resolvedDir, '.expo-go-export');\n\n  // 1. Install dependencies\n  console.log(`Installing dependencies in ${resolvedDir}...`);\n  execSync('yarn install', { cwd: resolvedDir, stdio: 'inherit' });\n\n  // 2. Export the iOS bundle\n  console.log(`\\nExporting iOS bundle...`);\n  execSync(`npx expo export --platform ios --output-dir \"${exportDir}\"`, {\n    cwd: resolvedDir,\n    stdio: 'inherit',\n    env: { ...process.env, EXPO_PUBLIC_SNACK_ENV: 'production' },\n  });\n\n  // 3. Find the .hbc bundle\n  const jsDir = path.join(exportDir, '_expo/static/js/ios');","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/expo/expo/blob/b09195aac27c9e4a63daaf12dcb6f00b6b2e08ee/apps/expo-go/scripts/download-snack-runtime.js#L113-L149","documentation":"Error \"Not a valid project directory (no package.json): ${resolvedDir}\" thrown in expo/expo.","triggerScenarios":"Thrown at apps/expo-go/scripts/download-snack-runtime.js:131 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b09195aac27c9e4a63daaf12dcb6f00b6b2e08ee","analyzedAt":"2026-08-12T15:59:58.304Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}