Create a new InstallerError.
The phase where the error occurred.
Machine-readable error code (e.g., 'NPM_INSTALL_FAILED').
Human-readable error description.
Actionable remediation step for the user.
OptionalcauseMachine-readable error code (e.g., 'NODE_VERSION', 'DOWNLOAD_FAILED').
Stable across versions — safe for programmatic error handling.
The installer phase where this error originated.
OptionalstackHuman-readable remediation step displayed to the user. Should be a concrete, actionable instruction (e.g., a command to run or a URL to visit).
Static OptionalprepareOptional override for formatting stack traces
Staticstack
Structured error thrown by installer phases when a recoverable or terminal failure occurs.
Unlike a generic
Error,InstallerErrorcarries machine-readable metadata that frontends use to render actionable diagnostics:The engine catches
InstallerErrorduring phase execution, records it in the checkpoint state file, and emits it via theerrorevent channel.Example