{/* The content of this doc is shared between the app and pages router. You can use the `<PagesOnly>Content</PagesOnly>` component to add content that is specific to the Pages Router. Any shared content should not be wrapped in a component. */}
## 从 13 升级到 14
要更新到 Next.js 14 版本,请使用您首选的包管理器运行以下命令:
```bash filename="Terminal"
npm i next@next-14 react@18 react-dom@18 && npm i eslint-config-next@next-14 -Dyarn add next@next-14 react@18 react-dom@18 && yarn add eslint-config-next@next-14 -Dpnpm i next@next-14 react@18 react-dom@18 && pnpm i eslint-config-next@next-14 -Dbun add next@next-14 react@18 react-dom@18 && bun add eslint-config-next@next-14 -D须知: 如果您正在使用 TypeScript,请确保将
@types/react和@types/react-dom也升级到最新版本。
next export 命令已被移除,取而代之的是 output: 'export' 配置。请参阅文档了解更多信息。ImageResponse 的 next/server 导入已被重命名为 next/og。提供了codemod,可安全自动地重命名您的导入。@next/font 包已被完全移除,取而代之的是内置的 next/font。提供了codemod,可安全自动地重命名您的导入。next-swc 的 WASM 目标已被移除。