To update to the latest Next.js canary version, you need to make sure you're on the latest stable version of Next.js first and everything is working as expected. Then, you can run the following command 1:
npm i next@canaryThe canary version includes the latest features that are still in development and not yet released in the stable version. Currently, the following features are available in the canary version 1:
Caching:
"use cache"cacheLifecacheTagdynamicIOAuthentication:
forbiddenunauthorizedforbidden.jsunauthorized.jsauthInterruptsIf you want to upgrade to the latest stable version of Next.js instead, you can use the upgrade codemod:
npx @next/codemod@canary upgrade latestOr manually install the latest versions:
npm i next@latest react@latest react-dom@latest eslint-config-next@latest