{"record":{"id":"e6d5b5829a3c9828","repo":"nodejs/node","slug":"s-not-found-cwd-s","errorCode":null,"errorMessage":"%s not found (cwd: %s)","messagePattern":"(.+?) not found \\(cwd: (.+?)\\)","errorType":"exception","errorClass":"GypError","httpStatus":null,"severity":"error","filePath":"tools/gyp/pylib/gyp/input.py","lineNumber":230,"sourceCode":"            kp.append(repr(index))\n            children.append(CheckNode(child, kp))\n        return children\n    elif isinstance(node, ast.Str):\n        return node.s\n    else:\n        raise TypeError(\n            \"Unknown AST node at key path '\" + \".\".join(keypath) + \"': \" + repr(node)\n        )\n\n\ndef LoadOneBuildFile(build_file_path, data, aux_data, includes, is_target, check):\n    if build_file_path in data:\n        return data[build_file_path]\n\n    if os.path.exists(build_file_path):\n        build_file_contents = open(build_file_path, encoding=\"utf-8\").read()\n    else:\n        raise GypError(f\"{build_file_path} not found (cwd: {os.getcwd()})\")\n\n    build_file_data = None\n    try:\n        if check:\n            build_file_data = CheckedEval(build_file_contents)\n        else:\n            build_file_data = eval(build_file_contents, {\"__builtins__\": {}}, None)\n    except SyntaxError as e:\n        e.filename = build_file_path\n        raise\n    except Exception as e:\n        gyp.common.ExceptionAppend(e, \"while reading \" + build_file_path)\n        raise\n\n    if not isinstance(build_file_data, dict):\n        raise GypError(\"%s does not evaluate to a dictionary.\" % build_file_path)\n\n    data[build_file_path] = build_file_data","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/tools/gyp/pylib/gyp/input.py#L212-L248","documentation":"Raised as a GypError by LoadOneBuildFile when the specified .gyp build file path does not exist on disk. The path is checked with os.path.exists before any read attempt; failure means gyp was pointed at a file (or an include) that isn't there, and the current working directory is included to help diagnose relative-path issues.","triggerScenarios":"Gyp tries to load a build file (directly or via an include) whose path does not resolve. os.path.exists returns False at input.py:227, raising with the path and os.getcwd().","commonSituations":"Wrong --depth or build file argument; an include path in a .gyp/.gypi pointing to a moved/deleted file; running gyp from the wrong working directory so relative paths break; case-sensitivity mismatch on case-sensitive filesystems.","solutions":["Verify the build file path exists (use the cwd shown in the message to resolve relative paths).","Run gyp from the correct working directory or use absolute/canonical paths.","Fix any include/dependencies references in .gyp/.gypi files to point at existing files.","Check for case-sensitivity or path-separator issues (especially cross-platform)."],"exampleFix":"# before — wrong path / wrong cwd\ngyp --depth=. build/notthere.gyp\n# after\ngyp --depth=. build/real_target.gyp","handlingStrategy":"validation","validationCode":"import os\nif not os.path.exists(build_file_path):\n    raise FileNotFoundError(f'{build_file_path} not found (cwd: {os.getcwd()})')","typeGuard":"import os\ndef build_file_exists(p) -> bool:\n    return os.path.exists(p)","tryCatchPattern":null,"preventionTips":["Resolve build-file paths against the documented working directory.","Verify includes reference existing files."],"tags":["gyp","input","file-not-found","filesystem","config"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}