From f14c96fb31bb7363c2eb4ea653e215d73fe58b84 Mon Sep 17 00:00:00 2001 From: Jeremiah Senkpiel Date: Fri, 24 Mar 2017 11:46:17 -0400 Subject: [PATCH] node: warn if cwd is inaccessible during bootstrap --- lib/internal/bootstrap_node.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/internal/bootstrap_node.js b/lib/internal/bootstrap_node.js index f29f7a647a4bd3..f428f49cfa50e6 100644 --- a/lib/internal/bootstrap_node.js +++ b/lib/internal/bootstrap_node.js @@ -374,6 +374,9 @@ threw = false; } finally { if (threw) { + process.emitWarning('The current working directory was inaccessible.' + + '\nFalling back to the executable\'s directory.', + 'BootstrapInaccessibleCwdWarning'); // getcwd(3) can fail if the current working directory has been deleted. // Fall back to the directory name of the (absolute) executable path. // It's not really correct but what are the alternatives?