Skip to content

Commit 869024f

Browse files
fix(cli): sets stack trace limit
modified the default stack trace limit and made cli to exit with exit code 1 when no args passed and webpack is not installed
1 parent 62e3c9e commit 869024f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

bin/cli.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,16 @@ For more information, see https://webpack.js.org/api/cli/.`);
7373
// When webpack is not installed and no args passed to the CLI
7474
if (err.code === "MODULE_NOT_FOUND") {
7575
let errorMessage =
76-
"\n\u001b[31mwebpack not found, please install webpack using\n\t\u001b[33mnpm install --save-dev webpack\n";
76+
"\n\u001b[31mwebpack not found, \u001b[33mplease install webpack using\n\t\u001b[32mnpm install --save-dev webpack\n";
7777

7878
if (process.env.npm_execpath !== undefined && process.env.npm_execpath.includes("yarn")) {
7979
errorMessage =
80-
"\n\u001b[31mwebpack not found, please install webpack using\n\t\u001b[33myarn add webpack --dev\n";
80+
"\n\u001b[31mwebpack not found, \u001b[33mplease install webpack using\n\t\u001b[32myarn add webpack --dev\n";
8181
}
8282

8383
console.error(errorMessage);
84+
Error.stackTraceLimit = 1;
85+
process.exitCode = 1;
8486
return;
8587
}
8688

0 commit comments

Comments
 (0)