{"record":{"id":"a88811f3df17ed31","repo":"nodejs/node","slug":"this-script-does-not-support-running-with-cygwin-p","errorCode":null,"errorMessage":"This script does not support running with cygwin python.","messagePattern":"This script does not support running with cygwin python\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"tools/build_addons.py","lineNumber":108,"sourceCode":"    codes = executor.map(node_gyp_rebuild, test_dirs)\n    return 0 if all(code == 0 for code in codes) else 1\n\ndef get_default_out_dir(args):\n  default_out_dir = os.path.join('out', args.config)\n  if not args.is_win:\n    # POSIX platforms only have one out dir.\n    return default_out_dir\n  # On Windows depending on the args of GYP and configure script, the out dir\n  # could be 'out/Release', 'out/Debug' or just 'Release' or 'Debug'.\n  if os.path.exists(default_out_dir):\n    return default_out_dir\n  if os.path.exists(args.config):\n    return args.config\n  raise RuntimeError('Cannot find out dir, did you run build?')\n\ndef main():\n  if sys.platform == 'cygwin':\n    raise RuntimeError('This script does not support running with cygwin python.')\n\n  parser = argparse.ArgumentParser(\n      description='Install headers and rebuild child directories')\n  parser.add_argument('target', help='target directory to build addons')\n  parser.add_argument('--headers-dir',\n                      help='path to node headers directory, if not specified '\n                           'new headers will be generated for building',\n                      default=None)\n  parser.add_argument('--out-dir', help='path to the output directory',\n                      default=None)\n  parser.add_argument('--loglevel', help='loglevel of node-gyp',\n                      default='silent')\n  parser.add_argument('--skip-tests', help='skip building tests',\n                      default='')\n  parser.add_argument('--only-tests', help='only build tests in the list',\n                      default='')\n  parser.add_argument('--node-gyp', help='path to node-gyp script',\n                      default='deps/npm/node_modules/node-gyp/bin/node-gyp.js')","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/tools/build_addons.py#L90-L126","documentation":"Raised at the top of main() in Node's tools/build_addons.py when sys.platform == 'cygwin', because the addon-build script does not support running under Cygwin Python (path handling, MSBuild invocation, and node-gyp behave incorrectly under the Cygwin POSIX layer on Windows).","triggerScenarios":"Invoking python tools/build_addons.py from a Cygwin shell/terminal where the python on PATH is the Cygwin build (sys.platform reports 'cygwin').","commonSituations":"A developer on Windows whose default python in the shell is Cygwin's rather than the native CPython; running the script through a Cygwin bash login shell.","solutions":["Run the script with native Windows CPython (e.g. py -3 tools/build_addons.py, or the python.exe from python.org) so sys.platform is 'win32'.","Run from cmd.exe or PowerShell rather than a Cygwin bash session.","Remove Cygwin Python from PATH precedence if native Python should be the default."],"exampleFix":"# before (Cygwin python)\npython tools/build_addons.py ./myaddon\n# after (native Windows python)\npy -3 tools/build_addons.py ./myaddon","handlingStrategy":"validation","validationCode":"import sys\nif sys.platform == 'cygwin':\n    raise SystemExit('Use native Windows Python (py -3), not Cygwin Python.')","typeGuard":"def is_native_windows_python() -> bool:\n    import sys\n    return sys.platform == 'win32'","tryCatchPattern":"null","preventionTips":["Run the script with native CPython (py -3 / python.exe from python.org).","Invoke from cmd.exe or PowerShell rather than a Cygwin shell.","Adjust PATH so native Python takes precedence over Cygwin Python."],"tags":["node","addons","windows","cygwin","environment"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}