Avoid logging expected error messages to the console
This commit is contained in:
@ -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");
|
||||||
|
Reference in New Issue
Block a user