nodejs/node · error · Exception

Only one of the --v8-enable-object-print or --v8-disable-obj

Error message

Only one of the --v8-enable-object-print or --v8-disable-object-print options can be specified at a time.

What it means

configure.py forbids passing both --v8-enable-object-print and --v8-disable-object-print. Unlike most options these are not argparse mutually-exclusive group flags; configure scans sys.argv directly and rejects the pair because they would write contradictory values into the same v8 variable.

Source

Thrown at configure.py:2260

      raise Exception('--enable-d8 is incompatible with --without-bundled-v8.')
    if options.enable_v8windbg:
      raise Exception('--enable-v8windbg is incompatible with --without-bundled-v8.')
    (pkg_libs, pkg_cflags, pkg_libpath, _) = pkg_config("v8")
    if pkg_libs and pkg_libpath:
      output['libraries'] += [pkg_libpath] + pkg_libs.split()
    if pkg_cflags:
      output['include_dirs'] += [flag for flag in [flag.strip() for flag in pkg_cflags.split('-I')] if flag]
  if options.static_zoslib_gyp:
    o['variables']['static_zoslib_gyp'] = options.static_zoslib_gyp
  if flavor != 'linux' and options.v8_enable_hugepage:
    raise Exception('--v8-enable-hugepage is supported only on linux.')
  o['variables']['v8_enable_hugepage'] = 1 if options.v8_enable_hugepage else 0
  if options.v8_enable_short_builtin_calls or o['variables']['target_arch'] == 'x64':
    o['variables']['v8_enable_short_builtin_calls'] = 1
  if options.v8_enable_snapshot_compression:
    o['variables']['v8_enable_snapshot_compression'] = 1
  if all(opt in sys.argv for opt in ['--v8-enable-object-print', '--v8-disable-object-print']):
    raise Exception(
        'Only one of the --v8-enable-object-print or --v8-disable-object-print options '
        'can be specified at a time.')
  if all(opt in sys.argv for opt in ['--v8-enable-temporal-support', '--v8-disable-temporal-support']):
    raise Exception(
        'Only one of the --v8-enable-temporal-support or --v8-disable-temporal-support options '
        'can be specified at a time.')
  if sys.platform != 'darwin':
    if o['variables']['v8_enable_webassembly'] and o['variables']['target_arch'] == 'x64':
      o['variables']['v8_enable_wasm_simd256_revec'] = 1

def configure_openssl(o):
  variables = o['variables']
  variables['node_use_openssl'] = b(not options.without_ssl)
  variables['node_shared_openssl'] = b(options.shared_openssl)
  variables['node_shared_ngtcp2'] = b(options.shared_ngtcp2)
  variables['node_shared_nghttp3'] = b(options.shared_nghttp3)
  variables['openssl_is_fips'] = b(options.openssl_is_fips)
  variables['node_fipsinstall'] = b(False)

View on GitHub (pinned to 1b2de5e052)

Solutions

  1. Pick exactly one of the two flags and delete the other from your configure command.
  2. Refactor the build wrapper to model object-print as a tri-state (on/off/unset) and emit only one flag.
  3. Add a pre-flight argv de-duplicater that rejects toggling pairs before invoking configure.

Example fix

// before
./configure --v8-enable-object-print --v8-disable-object-print
// after
./configure --v8-enable-object-print
Defensive patterns

Strategy: validation

Validate before calling

import sys
pair = {'--v8-enable-object-print', '--v8-disable-object-print'}
assert not pair.issubset(sys.argv), 'pass only one of the object-print flags'

Prevention

When it happens

Trigger: Raised when `all(opt in sys.argv for opt in ['--v8-enable-object-print','--v8-disable-object-print'])` is true. The check inspects raw argv, so the flags can appear anywhere, in any order.

Common situations: Build configs accumulated over time where enable and disable variants were both appended; templating bugs that concatenate a default flag list with an override list; copy-pasted CMake presets.

Related errors


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