-1

I was working on the Next.js app. I installed the react-use package in my Next.js project! Suddenly Next.js started throwing errors!

error

Then, I searched for similar errors on Stackoverflow. Some of them suggested removing node_modules and package-lock.json and trying to reinstall npm packages. I did so, but nothing seems working! Then restarted VSCode and computer, but the error was still there!

Even I tried to install that package, which is shown in error, but again it throwing an error for another package.

I am not sure why suddenly started throwing errors!

This is my package.json

package.json

I tried to update NextUI's latest version which is "@nextui-org/react": "^1.0.0-beta.9"

My current package.json file, after updating the NextUI

new package.json

Prathamesh More
  • 1,470
  • 2
  • 18
  • 32
  • 1
    Have you tried doing an `npm install @nextui-org/react@latest` ? The Dropdown component is apparently very new has a few other issues that were reported resolved in `beta.8`. – Soviut Jun 12 '22 at 05:23
  • Yes, tried but the same issue! – Prathamesh More Jun 12 '22 at 05:27
  • Please make sure to post code and errors as text directly to the question (and [not as images](https://meta.stackoverflow.com/questions/285551)), and [format them appropriately](https://stackoverflow.com/help/formatting). – juliomalves Jun 19 '22 at 14:52

1 Answers1

-1

Try to clean the cache and delete node_modules then install it again

npm cache verify

npm cache clean --force

Delete node_modules

npm install
Soviut
  • 88,194
  • 49
  • 192
  • 260
Prathamesh More
  • 1,470
  • 2
  • 18
  • 32
  • 1
    Did this actually work? Generally you shouldn't have to ever delete your `node_modules`. The reason deleting it sometimes fixes things is because the cache is in the directory (along with the downloaded packages) but if you've already done a cache clean, deleting is unnecessary. – Soviut Jun 12 '22 at 19:26
  • It didn't work for me deleting the cache. I am in the process of deleting and reinstalling the node modules to see if it works.... ...no, same error. ``` Module not found: Can't resolve '@react-stately/collections ``` – Fernando López Sep 19 '22 at 13:17