debug: add CLI debug output to diagnose version mismatch (v1.1.3)

This commit is contained in:
陈海富
2026-01-31 20:31:36 +08:00
parent 07ff31ffae
commit 45280c072a
2 changed files with 13 additions and 1 deletions

View File

@@ -19,6 +19,10 @@ const command = args[0] || 'dev';
// 获取包的根目录
const packageRoot = path.resolve(__dirname, '..');
// 调试信息
console.log('[DEBUG] __dirname:', __dirname);
console.log('[DEBUG] packageRoot:', packageRoot);
// 检查是否在正确的目录
const packageJsonPath = path.join(packageRoot, 'package.json');
if (!fs.existsSync(packageJsonPath)) {
@@ -26,6 +30,14 @@ if (!fs.existsSync(packageJsonPath)) {
process.exit(1);
}
// 读取并显示版本
try {
const pkg = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
console.log('[DEBUG] package.json version:', pkg.version);
} catch (e) {
console.error('[DEBUG] Failed to read package.json:', e.message);
}
// 检查依赖是否已安装
const nodeModulesPath = path.join(packageRoot, 'node_modules');
const esbuildPath = path.join(nodeModulesPath, '.bin', process.platform === 'win32' ? 'esbuild.cmd' : 'esbuild');

View File

@@ -1,6 +1,6 @@
{
"name": "cfspider-browser",
"version": "1.1.2",
"version": "1.1.3",
"description": "CFspider 智能浏览器 - AI驱动的浏览器自然语言控制浏览器自动化",
"keywords": [
"browser",