Skip to content

Commit 25a2b04

Browse files
committed
Allow Next.js version latest in package.json
1 parent 4bbead0 commit 25a2b04

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/init-stack/index.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ async function main() {
8181
`The project at ${projectPath} does not appear to be a Next.js project, or does not have 'next' installed as a dependency. Only Next.js projects are currently supported.`
8282
);
8383
}
84-
if (!packageJson.dependencies["next"].includes("14")) {
84+
const nextPackageJsonVersion = packageJson.dependencies["next"];
85+
if (!nextPackageJsonVersion.includes("14") && nextPackageJsonVersion !== "latest") {
8586
throw new UserError(
8687
`The project at ${projectPath} is using an unsupported version of Next.js (found ${packageJson.dependencies["next"]}).\n\nOnly Next.js 14 projects are currently supported. See Next's upgrade guide: https://nextjs.org/docs/app/building-your-application/upgrading/version-14`
8788
);

0 commit comments

Comments
 (0)