()
| 426 | } |
| 427 | |
| 428 | function getInstalledNextVersion(): string { |
| 429 | try { |
| 430 | return require( |
| 431 | require.resolve('next/package.json', { |
| 432 | paths: [cwd], |
| 433 | }) |
| 434 | ).version |
| 435 | } catch (error) { |
| 436 | throw new BadInput( |
| 437 | `Failed to get the installed Next.js version at "${cwd}".\nIf you're using a monorepo, please run this command from the Next.js app directory.`, |
| 438 | { |
| 439 | cause: error, |
| 440 | } |
| 441 | ) |
| 442 | } |
| 443 | } |
| 444 | |
| 445 | function getInstalledReactVersion(): string { |
| 446 | try { |
no test coverage detected