memento-mcp-server 1.7.4 → 1.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/INSTALL.md CHANGED
@@ -379,7 +379,35 @@ Remove-Item data\memory.db* -Force
379
379
  npm run db:init
380
380
  ```
381
381
 
382
- #### 5. Docker 오류
382
+ #### 5. Node.js 버전으로 인한 SQLite 모듈 오류
383
+
384
+ **증상**: "SQLite를 사용할 수 없습니다" 또는 "Module not found: better-sqlite3" 오류
385
+
386
+ **원인**: Node.js 버전이 높거나 낮아서 네이티브 모듈이 빌드되지 않음
387
+
388
+ **해결 방법**:
389
+
390
+ ```bash
391
+ # 방법 1: 네이티브 모듈 재빌드 (권장)
392
+ npm rebuild better-sqlite3 sqlite-vec
393
+
394
+ # 방법 2: 소스에서 빌드
395
+ npm install better-sqlite3 sqlite-vec --build-from-source
396
+
397
+ # 방법 3: Node.js 버전 확인 및 변경 (20.x 권장)
398
+ node --version # 20.x 이상이어야 함
399
+
400
+ # 방법 4: 완전 재설치
401
+ rm -rf node_modules package-lock.json
402
+ npm cache clean --force
403
+ npm install --build-from-source
404
+ ```
405
+
406
+ **상세 가이드**:
407
+ - [Node.js 버전 호환성 문제 해결 가이드](docs/troubleshooting-node-version.md)
408
+ - [npx 사용자 문제 해결 가이드](docs/npx-troubleshooting.md)
409
+
410
+ #### 6. Docker 오류
383
411
  ```bash
384
412
  # Docker 컨테이너 완전 정리
385
413
  docker-compose down -v
package/README.md CHANGED
@@ -110,6 +110,7 @@ npm run quick-start
110
110
  ### 📚 **상세 설치 가이드**
111
111
  - [INSTALL.md](INSTALL.md) - 전체 설치 가이드
112
112
  - [Cursor MCP 설정 가이드](docs/cursor-mcp-setup.ko.md) - Cursor에서 MCP 서버 사용하기
113
+ - [npx 사용자 문제 해결](docs/npx-troubleshooting.md) - npx 실행 시 문제 해결
113
114
 
114
115
  ## 💡 사용 예시
115
116
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "memento-mcp-server",
3
- "version": "1.7.4",
3
+ "version": "1.7.5",
4
4
  "description": "AI Agent 기억 보조 MCP 서버 - 사람의 기억 구조를 모사한 스토리지+검색+요약+망각 메커니즘",
5
5
  "main": "dist/server/index.js",
6
6
  "type": "module",
@@ -49,6 +49,7 @@
49
49
  "test:docker": "node test-docker.js",
50
50
  "setup": "node scripts/auto-setup.js",
51
51
  "postinstall": "node scripts/auto-setup.js",
52
+ "rebuild-native": "npm rebuild better-sqlite3 sqlite-vec",
52
53
  "prepublishOnly": "npm run build && npm run verify-bin",
53
54
  "verify-bin": "node scripts/verify-bin.js",
54
55
  "quick-start": "npm install && npm run setup && npm run dev",
@@ -113,6 +113,70 @@ async function initializeDatabase() {
113
113
  }
114
114
  }
115
115
 
116
+ async function rebuildNativeModules() {
117
+ try {
118
+ logStep('네이티브 모듈', 'better-sqlite3 및 sqlite-vec 재빌드 시도 중...');
119
+
120
+ const nodeModulesPath = path.join(projectRoot, 'node_modules');
121
+ if (!fs.existsSync(nodeModulesPath)) {
122
+ logWarning('node_modules가 없습니다. 먼저 npm install이 실행됩니다.');
123
+ return;
124
+ }
125
+
126
+ // 네이티브 모듈이 제대로 작동하는지 확인 (동적 import 사용)
127
+ try {
128
+ const betterSqlite3Path = path.join(nodeModulesPath, 'better-sqlite3');
129
+ if (fs.existsSync(betterSqlite3Path)) {
130
+ // 모듈 존재 확인만 (실제 로드는 나중에)
131
+ logSuccess('better-sqlite3 모듈 확인됨');
132
+ } else {
133
+ throw new Error('better-sqlite3 not found');
134
+ }
135
+ } catch (error) {
136
+ logWarning('better-sqlite3 모듈을 찾을 수 없거나 빌드가 필요합니다.');
137
+ logStep('재빌드', 'better-sqlite3 재빌드 중...');
138
+
139
+ try {
140
+ execSync('npm rebuild better-sqlite3', {
141
+ cwd: projectRoot,
142
+ stdio: 'inherit'
143
+ });
144
+ logSuccess('better-sqlite3 재빌드 완료');
145
+ } catch (rebuildError) {
146
+ logWarning(`better-sqlite3 재빌드 실패: ${rebuildError.message}`);
147
+ logWarning('수동으로 실행하세요: npm rebuild better-sqlite3');
148
+ }
149
+ }
150
+
151
+ // sqlite-vec도 확인 (선택적)
152
+ try {
153
+ const sqliteVecPath = path.join(nodeModulesPath, 'sqlite-vec');
154
+ if (fs.existsSync(sqliteVecPath)) {
155
+ logSuccess('sqlite-vec 모듈 확인됨');
156
+ } else {
157
+ throw new Error('sqlite-vec not found');
158
+ }
159
+ } catch (error) {
160
+ logWarning('sqlite-vec 모듈을 찾을 수 없거나 빌드가 필요합니다.');
161
+ logStep('재빌드', 'sqlite-vec 재빌드 시도 중...');
162
+
163
+ try {
164
+ execSync('npm rebuild sqlite-vec', {
165
+ cwd: projectRoot,
166
+ stdio: 'inherit'
167
+ });
168
+ logSuccess('sqlite-vec 재빌드 완료');
169
+ } catch (rebuildError) {
170
+ logWarning(`sqlite-vec 재빌드 실패: ${rebuildError.message}`);
171
+ logWarning('sqlite-vec는 선택적 의존성입니다. 벡터 검색 기능이 제한될 수 있습니다.');
172
+ }
173
+ }
174
+ } catch (error) {
175
+ logWarning(`네이티브 모듈 재빌드 중 오류: ${error.message}`);
176
+ logWarning('수동으로 실행하세요: npm rebuild better-sqlite3 sqlite-vec');
177
+ }
178
+ }
179
+
116
180
  async function checkDependencies() {
117
181
  const packageJsonPath = path.join(projectRoot, 'package.json');
118
182
  const nodeModulesPath = path.join(projectRoot, 'node_modules');
@@ -210,6 +274,15 @@ async function main() {
210
274
  try {
211
275
  log('🚀 Memento MCP Server 자동 설정을 시작합니다...', 'bright');
212
276
 
277
+ // npx를 통해 실행되는 경우 네이티브 모듈 재빌드 먼저 시도
278
+ const isNpx = process.env.npm_config_user_config === undefined ||
279
+ process.env.npm_execpath?.includes('npx') ||
280
+ process.env.npm_lifecycle_event === 'postinstall';
281
+
282
+ if (isNpx) {
283
+ await rebuildNativeModules();
284
+ }
285
+
213
286
  await checkNodeVersion();
214
287
  await checkDependencies();
215
288
  await createDataDirectory();