#Unable to install packages with Nextjs 15

9 messages · Page 1 of 1 (latest)

crimson basin
#

To Reproduce

  1. Create new nextjs app -> npx create-next-app; Select all the defaults.
  2. Try to npm install @headlessui/react or tailwindcss-animate or just npx shadcn init (select defaults)

Current vs Expected Behavior:

Error Log:

Something went wrong. Please check the error below for more details.
If the problem persists, please open an issue on GitHub.

Command failed with exit code 1: npm install tailwindcss-animate class-variance-authority lucide-react @radix-ui/react-icons clsx tailwind-merge
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: [email protected]
npm error Found: [email protected]
npm error node_modules/react
npm error react@"19.0.0-rc-69d4b800-20241021" from the root project
npm error
npm error Could not resolve dependency:
npm error peer react@"^16.x || ^17.x || ^18.x" from @radix-ui/[email protected]
npm error node_modules/@radix-ui/react-icons
npm error @radix-ui/react-icons@"*" 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.
npm error
npm error

Expected Behavior

Packages should install as expected.

Environment Information:

Node.js v22.9.0

Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 24.2.0: Tue Oct 15 18:15:36 PDT 2024; root:xnu-11215.60.364.501.5~3/RELEASE_ARM64_T6000
Available memory (MB): 16384
Available CPU cores: 8
Binaries:
Node: 22.9.0
npm: 10.8.3
Yarn: 1.22.22
pnpm: N/A
Relevant Packages:
next: 15.0.1 // Latest available version is detected (15.0.1).
eslint-config-next: N/A
react: 19.0.0-rc-69d4b800-20241021
react-dom: 19.0.0-rc-69d4b800-20241021
typescript: 5.6.3
Next.js Config:
output: N/A

broken chasmBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

keen bear
#

This isn't the GitHub issues page where you should report bugs instead.

Also this is just a peer dependency issue, pretty much none of the React ecosystem has listed the RC version of React in their peer dependencies so you will have to use --legacy-peer-deps or --force just like the npm error told you to.

crimson basin
#

Appreciate it. Just noticed that a lot of packages that were supported with next and react dependencies associated with 14 don't work with 15 and thought it was a larger issue related to react rc compatibility with older package versions

keen bear
#

It doesn't mean that the packages are no longer compatible, it just means that the original authors of the other packages haven't explicitly added the RC as a peer dep saying "yes, we do intend to support the RC with the current version". This is most notably due to the RC being, well ... an RC and not a conventional major and stable version. Realistically most packages will still work, only those that use certain changed or deprecated React 18 features that are different in React 19 will have issues, but those are only very few.

crimson basin
#

Thanks! I also checked next docs and it seems like next 15 has been battle tested across many scenarios and it's likely just what you mentioned. Will just use --legacy-peer-deps ; Just wish upgrading to a major stable release made major functionality work as they previously did (atleast basic stuff like installing packages), wish they wouldve stuck with react 18 and then did a better upgrade.

Out of curiosity, At Jetbrains if you use Next, have you upgraded to 15 in prod?

keen bear
#

We don't use Next and in any big corporate setting you'd wait with major updates for a significant amount of time.

lilac whale
#

plus still waiting probably 6 months regardless of if react19 releases tomorrow.