-
-
Notifications
You must be signed in to change notification settings - Fork 69.6k
[Bug]: memory-lancedb fails on macOS (pnpm global install) — apache-arrow + native bindings missing #22687
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
staleMarked as stale due to inactivityMarked as stale due to inactivity
Description
Summary
memory-lancedb extension fails with Cannot find module 'apache-arrow' when OpenClaw is installed globally via npm install -g openclaw on macOS (Apple Silicon).
Root Cause
pnpm workspace hoisting places @lancedb/lancedb under node_modules/.ignored/@lancedb/lancedb/ instead of the standard node_modules/@lancedb/lancedb/ path. This causes Node.js require() to fail at runtime for:
apache-arrow(peer dependency)flatbuffers(transitive dependency of apache-arrow)reflect-metadata(used by lancedb embedding registry)@lancedb/lancedb-darwin-arm64(native binary, optional dependency)
Additionally, @lancedb/lancedb's package.json exports field doesn't expose ./dist/arrow, which the extension's internal code requires.
Steps to Reproduce
- Install OpenClaw globally:
npm install -g openclaw - Enable
memory-lancedbextension - Try
memory_storeormemory_recall→ fails with:
memory-lancedb: failed to load LanceDB. Error: Cannot find module 'apache-arrow'
Require stack:
- .../extensions/memory-lancedb/node_modules/@lancedb/lancedb/dist/arrow.js
Workaround
Manual copy of missing dependencies into the extension's node_modules:
# 1. Install missing deps in temp dir
cd /tmp && mkdir arrow-fix && cd arrow-fix
npm init -y && npm install apache-arrow flatbuffers reflect-metadata @lancedb/[email protected]
# 2. Copy `.ignored` lancedb to proper path (with -RL to resolve symlinks)
EXT=$(npm root -g)/openclaw/extensions/memory-lancedb/node_modules
cp -RL $EXT/.ignored/@lancedb/lancedb $EXT/@lancedb/lancedb
# 3. Patch exports in package.json
python3 -c "import json;p='$EXT/@lancedb/lancedb/package.json';d=json.load(open(p));d['exports']['./dist/arrow']='./dist/arrow.js';json.dump(d,open(p,'w'),indent=2)"
# 4. Copy deps into lancedb's own node_modules
mkdir -p $EXT/@lancedb/lancedb/node_modules/@lancedb
cp -r /tmp/arrow-fix/node_modules/apache-arrow $EXT/@lancedb/lancedb/node_modules/
cp -r /tmp/arrow-fix/node_modules/flatbuffers $EXT/@lancedb/lancedb/node_modules/
cp -r /tmp/arrow-fix/node_modules/reflect-metadata $EXT/@lancedb/lancedb/node_modules/
cp -r /tmp/arrow-fix/node_modules/@lancedb/lancedb-darwin-arm64 $EXT/@lancedb/lancedb/node_modules/@lancedb/
# 5. Restart gateway
openclaw gateway restartEnvironment
- macOS 15.x (Apple Silicon M4)
- Node.js v25.6.1
- OpenClaw v2026.2.19-2 (npm global install)
- pnpm v10.23.0
@lancedb/lancedbv0.26.2
Suggested Fix
- Add
apache-arrow,flatbuffers,reflect-metadataas explicit dependencies inextensions/memory-lancedb/package.json - Ensure
@lancedb/lancedb-darwin-arm64(and other platform binaries) are included asoptionalDependencies - Fix the pnpm
.ignoredhoisting issue — possibly by using.npmrcwithshamefully-hoist=trueor explicitpnpm.overrides
Related: #19466 (Docker variant of the same issue)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
staleMarked as stale due to inactivityMarked as stale due to inactivity
Type
Fields
Give feedbackNo fields configured for issues without a type.