-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛[BUG] Error: Cannot find module './locale' #6512
Comments
我也是,昨天前天搭建Demo的时候还正常,今天重新clone后,跑不起来了 |
moment/moment#5472 Workaround: yarn add moment@2.24.0 |
一样 我今天clone新项目后 也起不来 warning in ./node_modules/@ant-design/pro-table/node_modules/moment/src/lib/locale/locales.js Critical dependency: the request of a dependency is an expression warning in ./node_modules/rc-picker/node_modules/moment/src/lib/locale/locales.js Critical dependency: the request of a dependency is an expression |
我试了 没用啊 |
你是不是修改版本号之后没有重新安装包 @ChenWeihua123 |
先把旧版本卸载,再重新安装,我这边是没问题的了 |
@QBH-insist yarn remove moment 然后 yarn add moment@2.24.0 |
操作是没问题,建议重新clone,再重新执行这2个步骤 |
@rapiz1 我重新安装了依赖包了 怎么回事呢 头痛 |
好的 谢谢 我试试 |
自动化构建工具jenkins 用这个方法没用。
antd@3.26.16 会默认装最新版 moment。 |
测试降级至@2.24.0可以解决问题 |
npm uninstall moment success! |
This only solves the main app. How do you override moment installed for others? As you can see below, the main app is 2.24.0. But others are still using 2.25.
|
yeah. i also have the problem. |
如果用的是yarn,在package.json里添加这样一句, |
the yarn setting can resolve the problem. the package.json dependencies also need set the 2.24.0 version. |
|
npm uninstall moment -S 再 重新 npm install moment@2.24.0 -S ,就可以了 |
good! It solved my problem |
hey @rapiz1 you just saved me. Thanks. |
Someone told here.uninstall moment and install 24.0 version but this is not working.I will fix |
你解决了吗、? |
我的问题和你一样。 参考这个文档: 太长不看:
但是要注意这样所有的moment都是2.24.0了,需要测试一下是否影响业务逻辑。 |
感谢,这波操作完可以动了 |
我卸载后重新安装也没用,还是照样报错 |
我用的是idea :1.移除:yarn remove moment 2.增加:yarn add moment@2.4.0 3.检查yarn.lock 是否有2.25.1moment 如果有,手动将2.25.1跟换为2.24.0,跟换时版本对应地址也要跟换。在yarn一下 启动项目ok. |
🐛 bug 描述
无法访问
localhost:8000
,加载一段时间后报错Error: Cannot find module './locale'
📷 复现步骤
yarn
yarn start
localhost:8000
🏞 期望结果
正常运行
© 版本信息
🚑 其他信息
The text was updated successfully, but these errors were encountered: