next-upgrade by vercel/nextjs-skills
npx skills add https://github.com/vercel/nextjs-skills --skill next-upgrade按照官方迁移指南,将当前项目升级至最新的 Next.js 版本。
检测当前版本:读取 package.json 以确定当前的 Next.js 版本及相关依赖(React、React DOM 等)。
获取最新的升级指南:使用 WebFetch 获取官方升级文档:
* 代码修改器:<https://nextjs.org/docs/app/guides/upgrading/codemods>
* 特定版本指南(根据需要调整版本):
* <https://nextjs.org/docs/app/guides/upgrading/version-16>
* <https://nextjs.org/docs/app/guides/upgrading/version-15>
* <https://nextjs.org/docs/app/guides/upgrading/version-14>
3. 确定升级路径:根据当前版本,确定哪些迁移步骤适用。对于主要版本升级,请逐步进行(例如,13 → 14 → 15)。
首先运行代码修改器:Next.js 提供了代码修改器来自动处理破坏性变更:
npx @next/codemod@latest <transform> <path>
常用转换:
* `next-async-request-api` \- 更新异步请求 API(v15)
* `next-request-geo-ip` \- 迁移 geo/ip 属性(v15)
* `next-dynamic-access-named-export` \- 转换动态导入(v15)
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
5. 更新依赖项:同时升级 Next.js 及其对等依赖项:
npm install next@latest react@latest react-dom@latest
6. 审查破坏性变更:检查升级指南中需要手动修改的部分:
* API 变更(例如,v15 中的异步参数)
* `next.config.js` 中的配置变更
* 已弃用且将被移除的功能
7. 更新 TypeScript 类型定义(如适用):
npm install @types/react@latest @types/react-dom@latest
8. 测试升级:
* 运行 `npm run build` 以检查构建错误
* 运行 `npm run dev` 并测试关键功能
每周安装次数
78
代码仓库
GitHub 星标数
775
首次出现
2026年2月11日
安全审计
安装于
gemini-cli75
codex75
opencode74
amp73
github-copilot72
kimi-cli71
Upgrade the current project to the latest Next.js version following official migration guides.
Detect current version : Read package.json to identify the current Next.js version and related dependencies (React, React DOM, etc.)
Fetch the latest upgrade guide : Use WebFetch to get the official upgrade documentation:
Determine upgrade path : Based on current version, identify which migration steps apply. For major version jumps, upgrade incrementally (e.g., 13 → 14 → 15).
Run codemods first : Next.js provides codemods to automate breaking changes:
npx @next/codemod@latest <transform> <path>
Common transforms:
* `next-async-request-api` \- Updates async Request APIs (v15)
* `next-request-geo-ip` \- Migrates geo/ip properties (v15)
* `next-dynamic-access-named-export` \- Transforms dynamic imports (v15)
5. Update dependencies : Upgrade Next.js and peer dependencies together:
npm install next@latest react@latest react-dom@latest
6. Review breaking changes : Check the upgrade guide for manual changes needed:
* API changes (e.g., async params in v15)
* Configuration changes in `next.config.js`
* Deprecated features being removed
7. Update TypeScript types (if applicable):
npm install @types/react@latest @types/react-dom@latest
8. Test the upgrade :
* Run `npm run build` to check for build errors
* Run `npm run dev` and test key functionality
Weekly Installs
78
Repository
GitHub Stars
775
First Seen
Feb 11, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
gemini-cli75
codex75
opencode74
amp73
github-copilot72
kimi-cli71