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-lancedb extension
- Try
memory_store or memory_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/lancedb-darwin-arm64@0.26.2
# 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 restart
Environment
- macOS 15.x (Apple Silicon M4)
- Node.js v25.6.1
- OpenClaw v2026.2.19-2 (npm global install)
- pnpm v10.23.0
@lancedb/lancedb v0.26.2
Suggested Fix
- Add
apache-arrow, flatbuffers, reflect-metadata as explicit dependencies in extensions/memory-lancedb/package.json
- Ensure
@lancedb/lancedb-darwin-arm64 (and other platform binaries) are included as optionalDependencies
- Fix the pnpm
.ignored hoisting issue — possibly by using .npmrc with shamefully-hoist=true or explicit pnpm.overrides
Related: #19466 (Docker variant of the same issue)
Summary
memory-lancedbextension fails withCannot find module 'apache-arrow'when OpenClaw is installed globally vianpm install -g openclawon macOS (Apple Silicon).Root Cause
pnpm workspace hoisting places
@lancedb/lancedbundernode_modules/.ignored/@lancedb/lancedb/instead of the standardnode_modules/@lancedb/lancedb/path. This causes Node.jsrequire()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'spackage.jsonexportsfield doesn't expose./dist/arrow, which the extension's internal code requires.Steps to Reproduce
npm install -g openclawmemory-lancedbextensionmemory_storeormemory_recall→ fails with:Workaround
Manual copy of missing dependencies into the extension's node_modules:
Environment
@lancedb/lancedbv0.26.2Suggested Fix
apache-arrow,flatbuffers,reflect-metadataas explicit dependencies inextensions/memory-lancedb/package.json@lancedb/lancedb-darwin-arm64(and other platform binaries) are included asoptionalDependencies.ignoredhoisting issue — possibly by using.npmrcwithshamefully-hoist=trueor explicitpnpm.overridesRelated: #19466 (Docker variant of the same issue)