{"record":{"id":"4258d3d9b54be802","repo":"nodejs/node","slug":"could-not-find-executable-should-be","errorCode":null,"errorMessage":"Could not find executable. Should be ","messagePattern":"Could not find executable\\. Should be ","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tools/test.py","lineNumber":992,"sourceCode":"\n  def GetVm(self, arch, mode):\n    if self.vm is not None:\n      return self.vm\n    if arch == 'none':\n      name = 'out/Debug/node' if mode == 'debug' else 'out/Release/node'\n    else:\n      name = 'out/%s.%s/node' % (arch, mode)\n\n    # Currently GYP does not support output_dir for MSVS.\n    # http://code.google.com/p/gyp/issues/detail?id=40\n    # It will put the builds into Release/node.exe or Debug/node.exe\n    if utils.IsWindows():\n      if not exists(name + '.exe'):\n        name = name.replace('out/', '')\n      name = os.path.abspath(name + '.exe')\n\n    if not exists(name):\n      raise ValueError('Could not find executable. Should be ' + name)\n\n    return name\n\n  def GetTimeout(self, mode, section=''):\n    timeout = self.timeout * TIMEOUT_SCALEFACTOR[ARCH_GUESS or 'ia32'][mode]\n    if section == 'pummel' or section == 'benchmark':\n      timeout = timeout * 6\n    # We run all WPT from one subset in the same process using workers.\n    # As the number of the tests grow, it can take longer to run some of the\n    # subsets, but it's still overall faster than running them in different\n    # processes.\n    elif section == 'wpt':\n      timeout = timeout * 12\n    return timeout\n\ndef RunTestCases(cases_to_run, progress, tasks, flaky_tests_mode, measure_flakiness):\n  progress = PROGRESS_INDICATORS[progress](cases_to_run, flaky_tests_mode, measure_flakiness)\n  return progress.Run(tasks)","sourceCodeStart":974,"sourceCodeEnd":1010,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/tools/test.py#L974-L1010","documentation":"The test runner's GetVm() computes the path to the node binary it will execute tests against (out/Release/node, out/Debug/node, out/<arch>.<mode>/node, or the Windows .exe variants) and checks it exists. If the binary is absent it raises ValueError, since no test could run.","triggerScenarios":"Running `python tools/test.py` (or `make test`) without building node first, or with --arch/--mode that select a build output directory that does not exist.","commonSituations":"Forgot to run make/ninja; built Release but tested Debug (or vice versa); ran `make clean` then test; cross-compiling without the target binary present.","solutions":["Build first with the matching config, e.g. `make -j$(nproc)` (produces out/Release/node).","Align --mode (release/debug) and --arch with the build output that exists.","On Windows ensure node.exe exists; the code falls back to Release/node.exe when out/... is missing."],"exampleFix":"// before\npython tools/test.py --mode=debug   # never built Debug\n// after\nmake -j$(nproc)                       # builds out/Release/node\npython tools/test.py --mode=release","handlingStrategy":"validation","validationCode":"import os\nexe='out/Release/node' if mode=='release' else 'out/Debug/node'\nassert os.path.exists(exe), f'missing {exe}; build first'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always build before running the test suite.","Keep --arch/--mode consistent with the directory you actually built into."],"tags":["testing","build","node","configuration"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}