{"record":{"id":"41d3e0ca82029c7e","repo":"tursodatabase/turso","slug":"native-binding-package-version-mismatch-expected-0-8-0-pre","errorCode":null,"errorMessage":"Native binding package version mismatch, expected 0.8.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.","messagePattern":"Native binding package version mismatch, expected 0\\.8\\.0-pre\\.10 but got (.+?)\\. You can reinstall dependencies to fix this issue\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"bindings/javascript/sync/packages/native/index.js","lineNumber":85,"sourceCode":"function requireNative() {\n  if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {\n    try {\n      nativeBinding = require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);\n    } catch (err) {\n      loadErrors.push(err)\n    }\n  } else if (process.platform === 'android') {\n    if (process.arch === 'arm64') {\n      try {\n        return require('./sync.android-arm64.node')\n      } catch (e) {\n        loadErrors.push(e)\n      }\n      try {\n        const binding = require('@tursodatabase/sync-android-arm64')\n        const bindingPackageVersion = require('@tursodatabase/sync-android-arm64/package.json').version\n        if (bindingPackageVersion !== '0.8.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {\n          throw new Error(`Native binding package version mismatch, expected 0.8.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)\n        }\n        return binding\n      } catch (e) {\n        loadErrors.push(e)\n      }\n    } else if (process.arch === 'arm') {\n      try {\n        return require('./sync.android-arm-eabi.node')\n      } catch (e) {\n        loadErrors.push(e)\n      }\n      try {\n        const binding = require('@tursodatabase/sync-android-arm-eabi')\n        const bindingPackageVersion = require('@tursodatabase/sync-android-arm-eabi/package.json').version\n        if (bindingPackageVersion !== '0.8.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {\n          throw new Error(`Native binding package version mismatch, expected 0.8.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)\n        }\n        return binding","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/tursodatabase/turso/blob/492c4a71cd7c2649e7df83da1471b74f4b1c7aa9/bindings/javascript/sync/packages/native/index.js#L67-L103","documentation":"The napi-rs generated loader for @tursodatabase/sync requires the platform-specific native package (here @tursodatabase/sync-android-arm64) to have exactly the same version as the JS wrapper (0.8.0-pre.10). When requireNative loads the android-arm64 binding and its package.json version differs, and NAPI_RS_ENFORCE_VERSION_CHECK is set to anything other than '0', it throws this Error. It exists to prevent ABI mismatches between the JS API and the compiled .node binary.","triggerScenarios":"Calling requireNative() on an Android arm64 device/emulator when require('@tursodatabase/sync-android-arm64') succeeds but its package.json version is not '0.8.0-pre.10' and NAPI_RS_ENFORCE_VERSION_CHECK is set (and not '0').","commonSituations":"Mixed lockfile states where some @tursodatabase/sync-* platform packages were updated and others weren't (partial npm/yarn/pnpm upgrade), cached stale packages in node_modules, manual package.json overrides or resolutions pinning one platform package differently, or installing the JS wrapper from a prerelease while platform packages resolve to different prerelease versions.","solutions":["Run 'npm install' (or yarn/pnpm install) after deleting node_modules and the lockfile entry so all @tursodatabase/sync-* platform packages reinstall at matching versions","Check that every installed @tursodatabase/sync-<platform> package reports version 0.8.0-pre.10 (npm ls @tursodatabase/sync-android-arm64)","If you knowingly want to skip the check, set NAPI_RS_ENFORCE_VERSION_CHECK=0 in the environment","Upgrade or downgrade the main @tursodatabase/sync package so its version matches the installed platform packages"],"exampleFix":"// before (mismatched package.json override)\n\"overrides\": { \"@tursodatabase/sync-android-arm64\": \"0.7.0\" }\n// after\n\"overrides\": { \"@tursodatabase/sync-android-arm64\": \"0.8.0-pre.10\" }","handlingStrategy":"validation","validationCode":"const platformPkg = require('@tursodatabase/sync-android-arm64/package.json');\nif (platformPkg.version !== require('@tursodatabase/sync/package.json').version) {\n  throw new Error(`Reinstall dependencies: binding version ${platformPkg.version} != wrapper version`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  const db = require('@tursodatabase/sync');\n} catch (e) {\n  if (e.message.includes('version mismatch')) {\n    console.error('Run: rm -rf node_modules && npm install');\n  }\n  throw e;\n}","preventionTips":["Always run a fresh install after bumping @tursodatabase/sync versions","Commit lockfiles so every machine/CI resolves identical platform package versions","Avoid package.json overrides/resolutions on @tursodatabase/sync-* platform packages","Verify with 'npm ls @tursodatabase/sync-android-arm64' in CI that versions align"],"tags":["nodejs","napi-rs","native-binding","version-mismatch","android"],"backgroundTag":"invalid-argument-value","analyzedSha":"492c4a71cd7c2649e7df83da1471b74f4b1c7aa9","analyzedAt":"2026-09-13T18:13:59.796Z","contentChangedAt":"2026-09-13T18:13:59.796Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}