How to install shadcn-ui on latest Next.js beta-RC

By

On current Next.js and React 19, use npx shadcn@latest init. The --force workaround was for the React 19 RC peer-dependency conflicts.

~~~

On current Next.js (15/16) with React 19 stable, the normal shadcn/ui install works:

npx shadcn@latest init

Then add components the same way:

npx shadcn@latest add button

You do not need --force for that path anymore.

When you still need —force

--force mattered during the Next.js / React 19 release-candidate window. At that time the RC shipped React 19 before many Radix and utility packages listed React 19 in their peer dependencies. Plain npx shadcn@latest init hit ERESOLVE and stopped.

If you are still on an old RC project, or you hit the same peer-dependency wall on another pre-release stack, force the install:

npx --force shadcn@latest init

Use the same flag when you add a component:

npx --force shadcn@latest add button

Why the RC install failed

When you run the shadcn/ui init command, it installs a set of dependencies into your project: the Radix UI primitives the components are built on, Tailwind helpers, and a few utilities.

During the RC period, many of those packages still declared React 18 as their peer dependency. The RC project used React 19. npm saw the mismatch, refused to install, and the setup stopped with an ERESOLVE error.

Nothing was actually broken at runtime in my tests. The packages ran fine on the new React. Their package.json files just hadn’t been updated yet. That lag is normal during a pre-release period.

What —force trades away

--force skips a safety check. npm stops verifying that the declared peer dependency ranges are satisfied, and installs whatever you asked for.

On the React 19 RC that was fine for me. On any pre-release stack, if a component misbehaves later, remember the warning you silenced: some dependency might genuinely not support that release yet.

Once you are on stable Next.js and React 19, prefer the plain commands without --force.

Tagged: Next.js · All topics

Want me to talk about your product? You can sponsor this site.

~~~

Related posts about next: