const { execSync } = require('child_process'); // 找 lanhu-mcp 可执行文件位置 for (const cmd of ['where lanhu-mcp', 'npm root -g', 'npm ls -g --depth=0']) { try { console.log('== ' + cmd + ' =='); console.log(execSync(cmd, { encoding: 'utf8', timeout: 15000 })); } catch (e) { console.log('(failed: ' + String(e.message).split('\n')[0] + ')'); } }