diff --git a/packages/cli/src/utils/resolvePath.ts b/packages/cli/src/utils/resolvePath.ts index 14d5f77cbb3..c0247fa22d9 100644 --- a/packages/cli/src/utils/resolvePath.ts +++ b/packages/cli/src/utils/resolvePath.ts @@ -17,5 +17,13 @@ export function resolvePath(p: string): string { } else if (p === '~' || p.startsWith('~/')) { expandedPath = homedir() + p.substring(1); } - return path.normalize(expandedPath); + try { + return path.normalize(expandedPath); + } catch (err: any) { + if (err.code === 'ENAMETOOLONG') { + return expandedPath; + } + throw err; + } + }