next-upgrade by vercel-labs/next-skills
npx skills add https://github.com/vercel-labs/next-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` \- 更新异步 Request 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` 并测试关键功能
每周安装量
7.5K
代码仓库
GitHub 星标数
765
首次出现
2026年1月26日
安全审计
已安装于
opencode6.0K
codex5.9K
gemini-cli5.7K
github-copilot5.7K
cursor5.6K
claude-code5.1K
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
7.5K
Repository
GitHub Stars
765
First Seen
Jan 26, 2026
Security Audits
Gen Agent Trust HubWarnSocketPassSnykPass
Installed on
opencode6.0K
codex5.9K
gemini-cli5.7K
github-copilot5.7K
cursor5.6K
claude-code5.1K
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
102,200 周安装