如何使用 React 17 安装 next-js?
How to install next-js with react 17?
如何使用 React 17 安装 next.js?当我输入:
npx create-next-app --ts, npx next installed Next with React 18,但我不能使用 React 18,因为 Stripe 目前无法使用 R18 (https://www.npmjs.com/package/stripe).
您需要使用旧版本的 Next JS。
我可以看到 React 17 的最新版本是 12.1.2,因此您可以使用以下内容开始您的项目:
npx create-next-app@12.1.2
您可以在此处查看 Next JS 的发布更改日志:
https://github.com/vercel/next.js/releases
如果您已经创建了项目:
删除新版本:
npm uninstall next react react-dom @types/react @types/react-dom
安装旧版本:
npm install next@12.1.2 react@17.0.2 react-dom@17.0.2
npm install -D @types/react@17.0.2 @types/react-dom@17.0.2
如何使用 React 17 安装 next.js?当我输入: npx create-next-app --ts, npx next installed Next with React 18,但我不能使用 React 18,因为 Stripe 目前无法使用 R18 (https://www.npmjs.com/package/stripe).
您需要使用旧版本的 Next JS。
我可以看到 React 17 的最新版本是 12.1.2,因此您可以使用以下内容开始您的项目:
npx create-next-app@12.1.2
您可以在此处查看 Next JS 的发布更改日志: https://github.com/vercel/next.js/releases
如果您已经创建了项目:
删除新版本:
npm uninstall next react react-dom @types/react @types/react-dom
安装旧版本:
npm install next@12.1.2 react@17.0.2 react-dom@17.0.2
npm install -D @types/react@17.0.2 @types/react-dom@17.0.2