[英]Module not found: Can't resolve '@react-stately/collections' in Next.js app
I was working on the Next.js app.我正在开发 Next.js 应用程序。 I installed the
react-use
package in my Next.js project!我在 Next.js 项目中安装了
react-use
包! Suddenly Next.js started throwing errors!突然 Next.js 开始抛出错误!
Then, I searched for similar errors on Stackoverflow.然后,我在 Stackoverflow 上搜索了类似的错误。 Some of them suggested removing
node_modules
and package-lock.json
and trying to reinstall npm packages.他们中的一些人建议删除
node_modules
和package-lock.json
并尝试重新安装 npm 包。 I did so, but nothing seems working!我这样做了,但似乎没有任何效果! Then restarted VSCode and computer, but the error was still there!
然后重新启动了VSCode和电脑,但错误仍然存在!
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"
我尝试更新 NextUI 的最新版本,即
"@nextui-org/react": "^1.0.0-beta.9"
My current package.json
file, after updating the NextUI我当前的
package.json
文件,更新 NextUI 后
Try to clean the cache and delete node_modules
then install it again尝试清理缓存并删除
node_modules
然后重新安装
npm cache verify
npm cache clean --force
Delete node_modules
删除
node_modules
npm install
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.