From c5043ae60d66f98638302c4358b83271ee647805 Mon Sep 17 00:00:00 2001 From: aarondill Date: Fri, 3 Feb 2023 14:06:29 -0600 Subject: [PATCH] default error source to process.cwd if require is not defined --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 741c36a..4d7d3a0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -214,7 +214,7 @@ export function printCommand(...commands: string[]) { /** @see https://github.com/uetchy/create-create-app */ export async function create(appName: string, options: Options) { - epicfail(require.main!.filename, { + epicfail(require?.main?.filename ?? process.cwd(), { assertExpected: (err) => err.name === 'CLIError', });