From 76324b80063152ce67c164b6f048682e71771bb6 Mon Sep 17 00:00:00 2001 From: Craig Rodrigues Date: Thu, 10 May 2018 12:14:33 -0700 Subject: [PATCH] fix(cli): add more verbose warning if '_debugger' module cannot be found. (#4800) --- lib/debugger/debuggerCommons.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/debugger/debuggerCommons.js b/lib/debugger/debuggerCommons.js index 6da09d583..f7b3b7833 100644 --- a/lib/debugger/debuggerCommons.js +++ b/lib/debugger/debuggerCommons.js @@ -1,4 +1,18 @@ -var baseDebugger = require('_debugger'); +var baseDebugger; +try { + baseDebugger = require('_debugger'); +} catch (e) { + if (e.code == 'MODULE_NOT_FOUND') { + console.log('***********************************************************'); + console.log('* WARNING: _debugger module not available on Node.js 8 *'); + console.log('* and higher. *'); + console.log('* *'); + console.log('* Use \'debugger\' keyword instead: *'); + console.log('* https://goo.gl/MvWqFh *'); + console.log('***********************************************************'); + } + throw e; +} var path = require('path'); /**