help icon indicating copy to clipboard operation
help copied to clipboard

ExecSync command fails without any error in the command being executed

Open hardikmodi1 opened this issue 1 year ago • 3 comments

Node.js Version

v18.18.2

NPM Version

v9.8.1

Operating System

Linux

Subsystem

child_process

Description

I am running tsc command using execSync with in gitlab pipelines. In most of the cases it works fine. But sometimes it fails without giving any error regarding tsc. Command I am executing is

execSync("yarn tsc", { stdio: 'inherit' });

I have wrapped this command in try catch and printed the exception, In cases where it fails it only prints following thing on console

Error: Command failed: yarn tsc
    at checkExecSyncError (node:child_process:890:11)
    at execSync (node:child_process:962:15)
    at /builds/scripts/tsc.ts:30:13
    at step (/builds/scripts/tsc.ts:44:23) {
  status: 129,
  signal: null,
  output: [ null, null, null ],
  pid: [204],
  stdout: null,
  stderr: null
}

Just rerunning the pipeline without any changes in the code this works fine.

Minimal Reproduction

No response

Output

No response

Before You Submit

  • [X] I have looked for issues that already exist before submitting this
  • [X] My issue follows the guidelines in the README file, and follows the 'How to ask a good question' guide at https://stackoverflow.com/help/how-to-ask

hardikmodi1 avatar Jul 05 '24 17:07 hardikmodi1