diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js index 23d72547ae900f..05a123feb9cfca 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -204,13 +204,7 @@ Object.defineProperty(process, 'argv0', { process.argv[0] = process.execPath; // Handle `--debug*` deprecation and invalidation. -if (process._invalidDebug) { - process.emitWarning( - '`node --debug` and `node --debug-brk` are invalid. ' + - 'Please use `node --inspect` or `node --inspect-brk` instead.', - 'DeprecationWarning', 'DEP0062', undefined, true); - process.exit(9); -} else if (process._deprecatedDebugBrk) { +if (process._deprecatedDebugBrk) { process.emitWarning( '`node --inspect --debug-brk` is deprecated. ' + 'Please use `node --inspect-brk` instead.', diff --git a/src/node_options.cc b/src/node_options.cc index 8bd8b827faa109..8e49fdbf389d60 100644 --- a/src/node_options.cc +++ b/src/node_options.cc @@ -30,6 +30,12 @@ void DebugOptions::CheckOptions(std::vector* errors) { "--without-v8-platform"); } #endif + + if (deprecated_debug && !inspector_enabled) { + errors->push_back("[DEP0062]: `node --debug` and `node --debug-brk` " + "are invalid. Please use `node --inspect` or " + "`node --inspect-brk` instead."); + } } void PerProcessOptions::CheckOptions(std::vector* errors) { diff --git a/src/node_options.h b/src/node_options.h index 50c66ce890bf4c..d4e373d05d9280 100644 --- a/src/node_options.h +++ b/src/node_options.h @@ -81,10 +81,6 @@ class DebugOptions : public Options { break_first_line; } - bool invalid_invocation() const { - return deprecated_debug && !inspector_enabled; - } - bool wait_for_connect() const { return break_first_line || break_node_first_line; } diff --git a/src/node_process_object.cc b/src/node_process_object.cc index c1f8806110ffef..89abe19a84ff57 100644 --- a/src/node_process_object.cc +++ b/src/node_process_object.cc @@ -265,12 +265,6 @@ MaybeLocal CreateProcessObject( "_deprecatedDebugBrk", True(env->isolate())); } - // --debug or, --debug-brk without --inspect - if (env->options()->debug_options().invalid_invocation()) { - READONLY_DONT_ENUM_PROPERTY(process, - "_invalidDebug", True(env->isolate())); - } - // --security-revert flags #define V(code, _, __) \ do { \