Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/memos-local-openclaw/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@
],
"license": "MIT",
"engines": {
"node": ">=18.0.0"
"node": ">=18.0.0 <25.0.0"
},
"dependencies": {
"@huggingface/transformers": "^3.8.0",
"@sinclair/typebox": "^0.34.48",
"better-sqlite3": "^12.6.2",
"better-sqlite3": "^12.6.3",
"posthog-node": "^5.28.0",
"puppeteer": "^24.38.0",
"uuid": "^10.0.0"
Expand Down
57 changes: 41 additions & 16 deletions apps/memos-local-openclaw/scripts/postinstall.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,23 @@ function phase(n, title) {

const pluginDir = path.resolve(__dirname, "..");

const nodeVersion = process.version;
const nodeMajor = parseInt(nodeVersion.slice(1).split('.')[0], 10);

console.log(`
${CYAN}${BOLD}┌──────────────────────────────────────────────────┐
│ MemOS Local Memory — postinstall setup │
└──────────────────────────────────────────────────┘${RESET}
`);

log(`Plugin dir: ${DIM}${pluginDir}${RESET}`);
log(`Node: ${process.version} Platform: ${process.platform}-${process.arch}`);
log(`Node: ${GREEN}${nodeVersion}${RESET} Platform: ${process.platform}-${process.arch}`);

if (nodeMajor >= 25) {
warn(`Node.js ${nodeVersion} detected. This version may have compatibility issues with native modules.`);
log(`Recommended: Use Node.js LTS (v20 or v22) for best compatibility.`);
log(`You can use nvm to switch versions: ${CYAN}nvm use 22${RESET}`);
}

/* ═══════════════════════════════════════════════════════════
* Phase 0: Ensure all dependencies are installed
Expand Down Expand Up @@ -281,23 +290,39 @@ ${GREEN}${BOLD} ┌────────────────────

console.log(`
${YELLOW}${BOLD} ╔══════════════════════════════════════════════════════════════╗
║ ✖ better-sqlite3 native module build failed ║
║ ✖ better-sqlite3 native module build failed
╠══════════════════════════════════════════════════════════════╣${RESET}
${YELLOW} ║${RESET} ${YELLOW}║${RESET}
${YELLOW} ║${RESET} This plugin requires C/C++ build tools to compile ${YELLOW}║${RESET}
${YELLOW} ║${RESET} the SQLite native module on first install. ${YELLOW}║${RESET}
${YELLOW} ║${RESET} ${YELLOW}║${RESET}
${YELLOW} ║${RESET} ${BOLD}Install build tools:${RESET} ${YELLOW}║${RESET}
${YELLOW} ║${RESET} ${YELLOW}║${RESET}
${YELLOW} ║${RESET} ${CYAN}macOS:${RESET} xcode-select --install ${YELLOW}║${RESET}
${YELLOW} ║${RESET} ${CYAN}Ubuntu:${RESET} sudo apt install build-essential python3 ${YELLOW}║${RESET}
${YELLOW} ║${RESET} ${CYAN}Windows:${RESET} npm install -g windows-build-tools ${YELLOW}║${RESET}
${YELLOW} ║${RESET} ${YELLOW}║${RESET}
${YELLOW} ║${RESET} ${BOLD}Then retry:${RESET} ${YELLOW}║${RESET}
${YELLOW} ║${RESET} ${YELLOW}║${RESET}
${YELLOW} ║${RESET} This plugin requires C/C++ build tools to compile ${YELLOW}║${RESET}
${YELLOW} ║${RESET} the SQLite native module on first install. ${YELLOW}║${RESET}
${YELLOW} ║${RESET} ${YELLOW}║${RESET}
${YELLOW} ║${RESET} ${BOLD}Install build tools:${RESET} ${YELLOW}║${RESET}
${YELLOW} ║${RESET} ${YELLOW}║${RESET}
${YELLOW} ║${RESET} ${CYAN}macOS:${RESET} xcode-select --install ${YELLOW}║${RESET}
${YELLOW} ║${RESET} ${CYAN}Ubuntu:${RESET} sudo apt install build-essential python3 ${YELLOW}║${RESET}
${YELLOW} ║${RESET} ${CYAN}Windows:${RESET} npm install -g windows-build-tools ${YELLOW}║${RESET}
${YELLOW} ║${RESET} ${YELLOW}║${RESET}`);

if (nodeMajor >= 25) {
console.log(`${YELLOW} ║${RESET} ${BOLD}${RED}Node.js v25+ compatibility issue detected:${RESET} ${YELLOW}║${RESET}
${YELLOW} ║${RESET} ${YELLOW}║${RESET}
${YELLOW} ║${RESET} better-sqlite3 may not have prebuilt binaries for Node 25. ${YELLOW}║${RESET}
${YELLOW} ║${RESET} ${BOLD}Recommended solutions:${RESET} ${YELLOW}║${RESET}
${YELLOW} ║${RESET} ${YELLOW}║${RESET}
${YELLOW} ║${RESET} 1. Use Node.js LTS (v20 or v22): ${YELLOW}║${RESET}
${YELLOW} ║${RESET} ${GREEN}nvm install 22 && nvm use 22${RESET} ${YELLOW}║${RESET}
${YELLOW} ║${RESET} ${YELLOW}║${RESET}
${YELLOW} ║${RESET} 2. Or use MemOS Cloud version instead: ${YELLOW}║${RESET}
${YELLOW} ║${RESET} ${CYAN}https://github.com/MemTensor/MemOS/tree/main/apps/memos-cloud${RESET}
${YELLOW} ║${RESET} ${YELLOW}║${RESET}`);
}

console.log(`${YELLOW} ║${RESET} ${YELLOW}║${RESET}
${YELLOW} ║${RESET} ${BOLD}Then retry:${RESET} ${YELLOW}║${RESET}
${YELLOW} ║${RESET} ${GREEN}cd ${pluginDir}${RESET}
${YELLOW} ║${RESET} ${GREEN}npm rebuild better-sqlite3${RESET} ${YELLOW}║${RESET}
${YELLOW} ║${RESET} ${GREEN}openclaw gateway stop && openclaw gateway start${RESET} ${YELLOW}║${RESET}
${YELLOW} ║${RESET} ${YELLOW}║${RESET}
${YELLOW} ║${RESET} ${GREEN}npm rebuild better-sqlite3${RESET} ${YELLOW}║${RESET}
${YELLOW} ║${RESET} ${GREEN}openclaw gateway stop && openclaw gateway start${RESET} ${YELLOW}║${RESET}
${YELLOW} ║${RESET} ${YELLOW}║${RESET}
${YELLOW}${BOLD} ╚══════════════════════════════════════════════════════════════╝${RESET}
`);

Expand Down