MCPcopy
hub / github.com/vercel/next.js / getInstalledNextVersion

Function getInstalledNextVersion

packages/next-codemod/bin/upgrade.ts:428–443  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

426}
427
428function 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
445function getInstalledReactVersion(): string {
446 try {

Callers 1

runUpgradeFunction · 0.85

Calls 2

resolveMethod · 0.65
requireFunction · 0.50

Tested by

no test coverage detected