Skip to content

Commit 7581bef

Browse files
authored
docs: pin react version to 18 in Next.js 14 upgrade guide (vercel#74222)
### Improving Documentation I was just upgrading from Next.js v13 to v14 following this guide: https://nextjs.org/docs/app/building-your-application/upgrading/version-14 npm installation throws the below error: ```sh npm error code ERESOLVE npm error ERESOLVE unable to resolve dependency tree npm error npm error While resolving: blog@0.0.8 npm error Found: react@19.0.0 npm error node_modules/react npm error react@"19.0.0" from the root project npm error npm error Could not resolve dependency: npm error peer react@"^18.2.0" from next@14.2.21 npm error node_modules/next npm error next@"14.2.21" from the root project npm error npm error Fix the upstream dependency conflict, or retry npm error this command with --force or --legacy-peer-deps npm error to accept an incorrect (and potentially broken) dependency resolution. ``` The react version for Next.js v14 should be pinned to react@18.
1 parent c99417e commit 7581bef

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/01-app/03-building-your-application/11-upgrading/04-version-14.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ description: Upgrade your Next.js Application from Version 13 to 14.
1010
To update to Next.js version 14, run the following command using your preferred package manager:
1111

1212
```bash filename="Terminal"
13-
npm i next@next-14 react@latest react-dom@latest && npm i eslint-config-next@next-14 -D
13+
npm i next@next-14 react@18 react-dom@18 && npm i eslint-config-next@next-14 -D
1414
```
1515

1616
```bash filename="Terminal"
17-
yarn add next@next-14 react@latest react-dom@latest && yarn add eslint-config-next@next-14 -D
17+
yarn add next@next-14 react@18 react-dom@18 && yarn add eslint-config-next@next-14 -D
1818
```
1919

2020
```bash filename="Terminal"
21-
pnpm i next@next-14 react@latest react-dom@latest && pnpm i eslint-config-next@next-14 -D
21+
pnpm i next@next-14 react@18 react-dom@18 && pnpm i eslint-config-next@next-14 -D
2222
```
2323

2424
```bash filename="Terminal"
25-
bun add next@next-14 react@latest react-dom@latest && bun add eslint-config-next@next-14 -D
25+
bun add next@next-14 react@18 react-dom@18 && bun add eslint-config-next@next-14 -D
2626
```
2727

2828
> **Good to know:** If you are using TypeScript, ensure you also upgrade `@types/react` and `@types/react-dom` to their latest versions.

0 commit comments

Comments
 (0)