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', });