mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
Avoid import.meta.dirname to be backwards compatible to Node.js 18+ (#1058)
This commit is contained in:
@@ -19,9 +19,11 @@
|
||||
|
||||
import { execSync } from 'child_process';
|
||||
import { rmSync } from 'fs';
|
||||
import { join } from 'path';
|
||||
import { dirname, join } from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
|
||||
const root = join(import.meta.dirname, '..');
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
const root = join(__dirname, '..');
|
||||
|
||||
// remove npm install/build artifacts
|
||||
rmSync(join(root, 'node_modules'), { recursive: true, force: true });
|
||||
|
||||
Reference in New Issue
Block a user