Skip to content

Commit f14c96f

Browse files
committed
node: warn if cwd is inaccessible during bootstrap
1 parent a8a042a commit f14c96f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/internal/bootstrap_node.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,9 @@
374374
threw = false;
375375
} finally {
376376
if (threw) {
377+
process.emitWarning('The current working directory was inaccessible.' +
378+
'\nFalling back to the executable\'s directory.',
379+
'BootstrapInaccessibleCwdWarning');
377380
// getcwd(3) can fail if the current working directory has been deleted.
378381
// Fall back to the directory name of the (absolute) executable path.
379382
// It's not really correct but what are the alternatives?

0 commit comments

Comments
 (0)