nodejs/node · error · RuntimeError

ZOSLIB_INCLUDES is not set to a valid location

Error message

ZOSLIB_INCLUDES is not set to a valid location

What it means

After confirming ZOSLIB_INCLUDES is set on z/OS, install.py checks that <ZOSLIB_INCLUDES>/zos-base.h is a real file. A value pointing at a non-existent or wrong directory is rejected so the header copy does not silently fail.

Source

Thrown at tools/install.py:376

  if 'true' == options.variables.get('node_use_openssl') and \
     'false' == options.variables.get('node_shared_openssl'):
    subdir_files(options, 'deps/openssl/openssl/include/openssl', 'include/node/openssl/', action)
    subdir_files(options, 'deps/openssl/config/archs', 'include/node/openssl/archs', action)
    subdir_files(options, 'deps/openssl/config', 'include/node/openssl', action)

  if 'false' == options.variables.get('node_shared_zlib'):
    action(options, [
      'deps/zlib/zconf.h',
      'deps/zlib/zlib.h',
    ], 'include/node/')

  if sys.platform == 'zos':
    zoslibinc = os.environ.get('ZOSLIB_INCLUDES')
    if not zoslibinc:
      raise RuntimeError('Environment variable ZOSLIB_INCLUDES is not set\n')
    if not os.path.isfile(zoslibinc + '/zos-base.h'):
      raise RuntimeError('ZOSLIB_INCLUDES is not set to a valid location\n')
    subdir_files(options, zoslibinc, 'include/node/zoslib/', wanted_zoslib_headers)

def run(options):
  if options.headers_only:
    if options.command == 'install':
      headers(options, install)
      return
    if options.command == 'uninstall':
      headers(options, uninstall)
      return
  else:
    if options.command == 'install':
      files(options, install)
      return
    if options.command == 'uninstall':
      files(options, uninstall)
      return

View on GitHub (pinned to 1b2de5e052)

Solutions

  1. Install zoslib, then point ZOSLIB_INCLUDES at the include directory that holds zos-base.h.
  2. Verify directly: `ls $ZOSLIB_INCLUDES/zos-base.h` must succeed.
  3. Re-export the corrected value and rerun install.

Example fix

// before
export ZOSLIB_INCLUDES=/opt/zoslib        # no zos-base.h here
// after
export ZOSLIB_INCLUDES=/opt/zoslib/include  # contains zos-base.h
ls $ZOSLIB_INCLUDES/zos-base.h
Defensive patterns

Strategy: validation

Validate before calling

import os, pathlib
v=os.environ['ZOSLIB_INCLUDES']
assert pathlib.Path(v,'zos-base.h').is_file(), f'{v}/zos-base.h not found'

Prevention

When it happens

Trigger: ZOSLIB_INCLUDES is exported but the directory lacks zos-base.h (typo, wrong release, not yet installed, points at a build dir rather than the install dir).

Common situations: zoslib not yet built/installed; path points at the zoslib source root instead of its include dir; trailing slash or casing mistake on a case-sensitive filesystem.

Related errors


AI-assisted analysis of nodejs/node@1b2de5e052 (2026-08-13). Data as JSON: /api/errors/b8a37dde0bd89cc3. Report an issue: GitHub.