nodejs/node · error · ValueError
converted value for %s not specified.
Error message
converted value for %s not specified.
What it means
_Enumeration.ConvertToMSBuild raises ValueError('converted value for %s not specified.') when the MSVS integer index is in range but maps to a None entry in _label_list. Enumerations use None placeholders for MSVS values that have no MSBuild equivalent (deprecated options). So the index is valid on the MSVS side but cannot be translated to MSBuild.
Source
Thrown at tools/gyp/pylib/gyp/MSVSSettings.py:215
def ValidateMSVS(self, value):
# Try to convert. It will raise an exception if not valid.
self.ConvertToMSBuild(value)
def ValidateMSBuild(self, value):
if value not in self._msbuild_values:
raise ValueError("unrecognized enumerated value %s" % value)
def ConvertToMSBuild(self, value):
index = int(value)
if index < 0 or index >= len(self._label_list):
raise ValueError(
"index value (%d) not in expected range [0, %d)"
% (index, len(self._label_list))
)
label = self._label_list[index]
if label is None:
raise ValueError("converted value for %s not specified." % value)
return label
# Instantiate the various generic types.
_boolean = _Boolean()
_integer = _Integer()
# For now, we don't do any special validation on these types:
_string = _String()
_file_name = _String()
_folder_name = _String()
_file_list = _StringList()
_folder_list = _StringList()
_string_list = _StringList()
# Some boolean settings went from numerical values to boolean. The
# mapping is 0: default, 1: false, 2: true.
_newly_boolean = _Enumeration(["", "false", "true"])
View on GitHub (pinned to 1b2de5e052)
Solutions
- Find the _Enumeration definition and pick an index whose label is not None.
- Migrate the deprecated option to its modern MSBuild equivalent (consult MSVSSettings conversion table).
- Drop the setting on the MSBuild side and set it only in msvs_settings if MSVS-only output is needed.
Example fix
# before: index maps to None placeholder (deprecated option) 'Optimization': '1', # label is None in this enumeration # after: choose an index with a real MSBuild label 'Optimization': '2',
Defensive patterns
Strategy: validation
Validate before calling
def has_msbuild_label(enum_type, index):
i = int(index)
return 0 <= i < len(enum_type._label_list) and enum_type._label_list[i] is not None Type guard
def index_translates_to_msbuild(enum_type, value) -> bool:
try:
return enum_type._label_list[int(value)] is not None
except (IndexError, ValueError, TypeError):
return False Try / catch
try:
enum_type.ConvertToMSBuild(my_value)
except ValueError as e:
if 'not specified' in str(e):
# deprecated option with no MSBuild equivalent -> drop or remap
my_value = None # caller omits the setting Prevention
- Avoid MSVS enumeration entries whose label is None (deprecated options).
- When upgrading VS versions, audit for newly-deprecated options and remap them.
- Keep a mapping table from legacy options to their modern MSBuild equivalents.
When it happens
Trigger: Using a deprecated/removed MSVS compiler option (e.g. an old /O style) whose slot is None in the label list, then converting to MSBuild; an enumeration built with explicit None entries for legacy values.
Common situations: Upgrading a project from VCExpress/VS2005 era settings that no longer exist in modern MSBuild; preserving an old .gyp whose enumeration placeholders have since been nulled.
Related errors
- value must be one of [0, 1, 2]; got %s
- expected bool; got %r
- unrecognized enumerated value %s
- index value (%d) not in expected range [0, %d)
- %s requires any SDK of %s version, but none were found
AI-assisted analysis of nodejs/node@1b2de5e052 (2026-08-13).
Data as JSON: /api/errors/c44a85786d553766.
Report an issue: GitHub.