Next.js Discord

Discord Forum

Getting Errors when trying to install or uninstall packages (React 19)

Answered
Sun bear posted this in #help-forum
Open in Discord
Sun bearOP
I am getting these errors in the screenshot whenever I try to uninstall a package. I know how to get around them but I wonder if theres a way to solve this without downgrading.
Answered by Anay-208 | Ping in replies
it is because headlessui doesn't support react 19
View full answer

18 Replies

Sun bearOP
@Anay-208 | Ping in replies
Answer
Sun bearOP
But didn't React 19 come out a while ago, are they still updating headless ui or ?
try updating it
try updating headlessui to latest version
Sun bearOP
Do you know the command ?
For npm
I think I found it but that too gives errors lol
Perhaps I need to uninstall the old one first
Sun bearOP
I managed to update it using legacy peer deps
But I still get similar errors when installing / uninstalling stuff
I've started clearing some of the packages which return those errors
And cleaned / reinstalled some stuff
@Sun bear Do you know the command ?
You should see it in the error message
the package, install it to @latest
Sun bearOP
So after updating the headless ui library and uninstalling 2 others I also ran these commands:

sudo chown -R $USER:$GROUP ~/.npm
sudo chown -R $USER:$GROUP ./node_modules

npm audit fix --force --legacy-peer-deps

npm install @clerk/clerk-react@beta --legacy-peer-deps
npm install swr@latest --force

I think running these commands as well helped fixing the issues.
Thank you very much for your help Anay!
I can confirm the issues are solved!