Next.js Discord

Discord Forum

Upgrading to NextJs 15

Answered
Tonkinese posted this in #help-forum
Open in Discord
Avatar
TonkineseOP
When i try to upgrade to nextjs 15 using " npm i @codemod@ canary upgrade latest"
i get this error "React: v18.3.1Next.js: v14.2.13 SyntaxError: Unexpected end of JSON input at JSON.parse () at loadHighestNPMVersionMatching"

How can i fix it
Answered by flap
@Tonkinese You should be using npx and not npm, the correct syntax is as follows: npx @next/codemod@canary upgrade latest. This will upgrade to 15.0.1.

To upgrade to 15.0.2-canary.6 run npx @next/codemod@canary upgrade 15.0.2-canary.6
View full answer

2 Replies

Avatar
@Tonkinese You should be using npx and not npm, the correct syntax is as follows: npx @next/codemod@canary upgrade latest. This will upgrade to 15.0.1.

To upgrade to 15.0.2-canary.6 run npx @next/codemod@canary upgrade 15.0.2-canary.6
Answer
Avatar
TonkineseOP