claude-flow 2.7.42 → 2.7.43
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/bin/claude-flow +1 -1
- package/dist/src/cli/simple-commands/config.js +0 -124
- package/dist/src/cli/simple-commands/config.js.map +1 -1
- package/dist/src/cli/simple-commands/hive-mind.js +42 -5
- package/dist/src/cli/simple-commands/hive-mind.js.map +1 -1
- package/dist/src/cli/simple-commands/hooks.js +21 -1
- package/dist/src/cli/simple-commands/hooks.js.map +1 -1
- package/dist/src/cli/validation-helper.js.map +1 -1
- package/dist/src/core/DatabaseManager.js +19 -2
- package/dist/src/core/DatabaseManager.js.map +1 -1
- package/dist/src/core/version.js +2 -2
- package/dist/src/core/version.js.map +1 -1
- package/dist/src/memory/sqlite-wrapper.js +52 -14
- package/dist/src/memory/sqlite-wrapper.js.map +1 -1
- package/dist/src/utils/error-recovery.js +29 -0
- package/dist/src/utils/error-recovery.js.map +1 -1
- package/package.json +1 -1
- package/src/cli/simple-commands/hooks.js +31 -1
- package/src/core/DatabaseManager.ts +27 -2
- package/src/memory/sqlite-wrapper.js +63 -19
- package/src/utils/error-recovery.ts +48 -0
|
@@ -33,6 +33,52 @@ export function isNpmCacheError(error: any): boolean {
|
|
|
33
33
|
) || errorStr.includes('better-sqlite3');
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
/**
|
|
37
|
+
* Detect if an error is a native module version mismatch (NODE_MODULE_VERSION)
|
|
38
|
+
* This happens when native modules are compiled for a different Node.js version
|
|
39
|
+
*/
|
|
40
|
+
export function isNativeModuleVersionError(error: any): boolean {
|
|
41
|
+
const errorStr = error?.message || String(error);
|
|
42
|
+
return (
|
|
43
|
+
errorStr.includes('NODE_MODULE_VERSION') ||
|
|
44
|
+
errorStr.includes('was compiled against a different Node.js version') ||
|
|
45
|
+
errorStr.includes('re-compiling or re-installing the module')
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Get helpful message for native module version mismatch
|
|
51
|
+
*/
|
|
52
|
+
export function getNativeModuleRecoveryMessage(error: any): string {
|
|
53
|
+
const errorStr = error?.message || String(error);
|
|
54
|
+
|
|
55
|
+
// Extract version numbers if available
|
|
56
|
+
const compiledMatch = errorStr.match(/NODE_MODULE_VERSION (\d+)/);
|
|
57
|
+
const requiredMatch = errorStr.match(/requires\s+NODE_MODULE_VERSION (\d+)/);
|
|
58
|
+
|
|
59
|
+
let message = '⚠️ Native module version mismatch detected.\n';
|
|
60
|
+
|
|
61
|
+
if (compiledMatch && requiredMatch) {
|
|
62
|
+
const nodeVersionMap: Record<string, string> = {
|
|
63
|
+
'108': '18.x',
|
|
64
|
+
'115': '20.x',
|
|
65
|
+
'120': '21.x',
|
|
66
|
+
'127': '22.x',
|
|
67
|
+
'131': '23.x'
|
|
68
|
+
};
|
|
69
|
+
const compiled = nodeVersionMap[compiledMatch[1]] || `ABI ${compiledMatch[1]}`;
|
|
70
|
+
const required = nodeVersionMap[requiredMatch[1]] || `ABI ${requiredMatch[1]}`;
|
|
71
|
+
message += ` Module was compiled for Node.js ${compiled}, but running Node.js ${required}.\n`;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
message += '\n To fix this, try one of:\n';
|
|
75
|
+
message += ' 1. npm rebuild better-sqlite3\n';
|
|
76
|
+
message += ' 2. rm -rf node_modules && npm install\n';
|
|
77
|
+
message += ' 3. npx cache: rm -rf ~/.npm/_npx/ && run command again\n';
|
|
78
|
+
|
|
79
|
+
return message;
|
|
80
|
+
}
|
|
81
|
+
|
|
36
82
|
/**
|
|
37
83
|
* Detect if running on WSL (Windows Subsystem for Linux)
|
|
38
84
|
*/
|
|
@@ -315,6 +361,8 @@ export async function recoverInitErrors(error: any): Promise<RecoveryResult> {
|
|
|
315
361
|
*/
|
|
316
362
|
export const errorRecovery = {
|
|
317
363
|
isNpmCacheError,
|
|
364
|
+
isNativeModuleVersionError,
|
|
365
|
+
getNativeModuleRecoveryMessage,
|
|
318
366
|
isWSL,
|
|
319
367
|
cleanNpmCache,
|
|
320
368
|
retryWithRecovery,
|