Node DeprecationWarning Treated as Error in CI - Stop the Failing Warning
Node deprecation warnings are advisory by default, but --throw-deprecation upgrades them to thrown errors, so a deprecated API call crashes the job.
What this error means
A CI step exits non-zero on a DeprecationWarning, with a stack rather than a plain warning line, because the process was started with --throw-deprecation.
node:internal/process/warning:130
throw warning;
^
DeprecationWarning: The `util.isArray` API is deprecated. Please use
`Array.isArray()` instead.
at emitDeprecationWarning (node:internal/util:80:11)Common causes
--throw-deprecation is enabled
A flag or NODE_OPTIONS in CI turns deprecation warnings into thrown errors, so any deprecated API aborts the run.
Code or a dependency uses a deprecated API
A removed-soon API is still being called, and with throw-on-deprecation that call becomes fatal.
How to fix it
Replace the deprecated API
- Read the warning to identify the deprecated call.
- Switch to the recommended replacement.
- Re-run to confirm the warning no longer fires.
Array.isArray(value); // instead of util.isArray(value)Drop the throw-deprecation flag if intentional warnings remain
- Remove --throw-deprecation from NODE_OPTIONS or the run command.
- Address the underlying deprecated calls separately.
How to prevent it
- Keep --throw-deprecation off in CI unless you are deliberately auditing, fix deprecated API usage promptly, and watch dependency upgrade notes for newly deprecated calls.