Skip to content

Commit c5043ae

Browse files
committed
default error source to process.cwd if require is not defined
1 parent 69a87e3 commit c5043ae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ export function printCommand(...commands: string[]) {
214214

215215
/** @see https://github.com/uetchy/create-create-app */
216216
export async function create(appName: string, options: Options) {
217-
epicfail(require.main!.filename, {
217+
epicfail(require?.main?.filename ?? process.cwd(), {
218218
assertExpected: (err) => err.name === 'CLIError',
219219
});
220220

0 commit comments

Comments
 (0)