Avoid logging expected error messages to the console

This commit is contained in:
Joseph Garrone
2024-04-17 15:57:13 +02:00
parent ff1758cdce
commit 51bc65e671

View File

@ -26,7 +26,7 @@ export function getNpmWorkspaceRootDirPath(params: { reactAppRootDirPath: string
const cwd = pathResolve(pathJoin(...[reactAppRootDirPath, ...Array(depth).fill("..")])); const cwd = pathResolve(pathJoin(...[reactAppRootDirPath, ...Array(depth).fill("..")]));
try { try {
child_process.execSync("npm config get", { cwd: cwd }); child_process.execSync("npm config get", { cwd, "stdio": ["pipe", "pipe", "pipe"] });
} catch (error) { } catch (error) {
if (String(error).includes("ENOWORKSPACES")) { if (String(error).includes("ENOWORKSPACES")) {
assert(cwd !== pathSep, "NPM workspace not found"); assert(cwd !== pathSep, "NPM workspace not found");