{"record":{"id":"2418a0f090ef0744","repo":"nodejs/node","slug":"environment-variable-zoslib-includes-is-not-set","errorCode":null,"errorMessage":"Environment variable ZOSLIB_INCLUDES is not set\n","messagePattern":"Environment variable ZOSLIB_INCLUDES is not set\n","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"tools/install.py","lineNumber":374,"sourceCode":"  if 'false' == options.variables.get('node_shared_libuv'):\n    subdir_files(options, 'deps/uv/include', 'include/node/', action)\n\n  if 'true' == options.variables.get('node_use_openssl') and \\\n     'false' == options.variables.get('node_shared_openssl'):\n    subdir_files(options, 'deps/openssl/openssl/include/openssl', 'include/node/openssl/', action)\n    subdir_files(options, 'deps/openssl/config/archs', 'include/node/openssl/archs', action)\n    subdir_files(options, 'deps/openssl/config', 'include/node/openssl', action)\n\n  if 'false' == options.variables.get('node_shared_zlib'):\n    action(options, [\n      'deps/zlib/zconf.h',\n      'deps/zlib/zlib.h',\n    ], 'include/node/')\n\n  if sys.platform == 'zos':\n    zoslibinc = os.environ.get('ZOSLIB_INCLUDES')\n    if not zoslibinc:\n      raise RuntimeError('Environment variable ZOSLIB_INCLUDES is not set\\n')\n    if not os.path.isfile(zoslibinc + '/zos-base.h'):\n      raise RuntimeError('ZOSLIB_INCLUDES is not set to a valid location\\n')\n    subdir_files(options, zoslibinc, 'include/node/zoslib/', wanted_zoslib_headers)\n\ndef run(options):\n  if options.headers_only:\n    if options.command == 'install':\n      headers(options, install)\n      return\n    if options.command == 'uninstall':\n      headers(options, uninstall)\n      return\n  else:\n    if options.command == 'install':\n      files(options, install)\n      return\n    if options.command == 'uninstall':\n      files(options, uninstall)","sourceCodeStart":356,"sourceCodeEnd":392,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/tools/install.py#L356-L392","documentation":"On IBM z/OS (sys.platform == 'zos'), installing node headers requires copying the zoslib headers into include/node/zoslib. install.py reads the ZOSLIB_INCLUDES environment variable to find them and aborts if it is unset.","triggerScenarios":"Running `python tools/install.py install` (or the header install path) on z/OS without ZOSLIB_INCLUDES exported in the environment.","commonSituations":"Fresh z/OS build machine whose env-setup script was not sourced; CI job missing the variable; switching to a new shell that lost the export.","solutions":["Export ZOSLIB_INCLUDES to your zoslib include directory before installing, e.g. `export ZOSLIB_INCLUDES=/path/to/zoslib/include` (the dir must contain zos-base.h).","Source the z/OS build environment setup script that defines it.","Set it persistently in your shell profile / CI environment."],"exampleFix":"// before\npython tools/install.py install   # on z/OS, ZOSLIB_INCLUDES unset\n// after\nexport ZOSLIB_INCLUDES=/usr/local/zoslib/include\npython tools/install.py install","handlingStrategy":"validation","validationCode":"import os, sys, pathlib\nif sys.platform=='zos':\n    v=os.environ.get('ZOSLIB_INCLUDES')\n    assert v, 'ZOSLIB_INCLUDES must be set on z/OS'\n    assert pathlib.Path(v,'zos-base.h').is_file()","typeGuard":null,"tryCatchPattern":null,"preventionTips":["On z/OS, always source the env setup that exports ZOSLIB_INCLUDES before building/installing node.","Add the variable to CI environment definitions for z/OS jobs."],"tags":["install","zos","environment","node"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}