()
| 443 | } |
| 444 | |
| 445 | function getInstalledReactVersion(): string { |
| 446 | try { |
| 447 | return require( |
| 448 | require.resolve('react/package.json', { |
| 449 | paths: [cwd], |
| 450 | }) |
| 451 | ).version |
| 452 | } catch (error) { |
| 453 | throw new BadInput( |
| 454 | `Failed to detect the installed React version in "${cwd}".\nIf you're working in a monorepo, please run this command from the Next.js app directory.`, |
| 455 | { |
| 456 | cause: error, |
| 457 | } |
| 458 | ) |
| 459 | } |
| 460 | } |
| 461 | |
| 462 | function isUsingPagesDir(projectPath: string): boolean { |
| 463 | return ( |
no test coverage detected