Browse Source

fix: 修正 h5_for_webserver.build.js 中 taro 命令在 CI 环境中不可用的问题

- 将 'taro build' 改为 'npx taro build'
- 确保 CI 环境中能够正确找到并执行 taro 命令
- 修复 GitHub Actions workflow 构建失败的问题
dengdx 1 month ago
parent
commit
01fc1b95ec
1 changed files with 1 additions and 1 deletions
  1. 1 1
      .build/h5_for_webserver.build.js

+ 1 - 1
.build/h5_for_webserver.build.js

@@ -9,7 +9,7 @@ const TARO_MQTT_URL = '/mqtt';  // 使用相对路径,由 nginx 代理转发
 const rootDir = path.join(__dirname, '..');          // 项目根目录
 
 
-execSync(`taro build --type h5`, { cwd: rootDir, stdio: 'inherit', env: { ...process.env, TARO_API_URL, TARO_MQTT_URL } }, (error, stdout, stderr) => {
+execSync(`npx taro build --type h5`, { cwd: rootDir, stdio: 'inherit', env: { ...process.env, TARO_API_URL, TARO_MQTT_URL } }, (error, stdout, stderr) => {
     if (error) {
         console.error(`Error executing command: ${error.message}`);
         return;