get-node-paths.js 578 B

12345678910111213141516
  1. #!/usr/bin/env node
  2. /**
  3. * 输出 Node.js/npm/Python 路径(供 PowerShell / bat 等脚本读取 config.js)
  4. * 用法: node configs/get-node-paths.js
  5. * 输出 JSON: { arch, nodeDir, npmCmdPath, npmCliPath, pythonDir, pythonVenvPath }
  6. */
  7. const path = require('path');
  8. const config = require(path.join(__dirname, 'config.js'));
  9. console.log(JSON.stringify({
  10. arch: config.arch,
  11. nodeDir: config.nodeDir,
  12. npmCmdPath: config.npmCmdPath,
  13. npmCliPath: config.npmCliPath,
  14. pythonDir: config.pythonDir || config.pythonPath?.path,
  15. pythonVenvPath: config.pythonVenvPath
  16. }));