start.js 338 B

1234567891011
  1. const { execSync } = require('child_process');
  2. const fs = require('fs');
  3. // 检查 node_modules 是否存在
  4. if (!fs.existsSync('node_modules')) {
  5. console.log('node_modules 不存在,正在安装依赖...');
  6. execSync('npm install', { stdio: 'inherit' });
  7. }
  8. // 启动应用
  9. execSync('node build/app.js', { stdio: 'inherit' });