运行 vue 项目时,警告”多个模块的名称只是大小写不同“

发布于 2022-09-12 13:12:44 字数 1959 浏览 13 评论 0

 warning  in ./node_modules/Vant/es/utils/validate/number.js

There are multiple modules with names that only differ in casing.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
Use equal casing. Compare these module identifiers:
* D:\SYGT_Mey\zcmu_appointment\node_modules\Vant\es\utils\validate\number.js
    Used by 5 module(s), i. e.
    D:\SYGT_Mey\zcmu_appointment\node_modules\Vant\es\datetime-picker\utils.js
* D:\SYGT_Mey\zcmu_appointment\node_modules\vant\es\utils\validate\number.js
    Used by 5 module(s), i. e.
    D:\SYGT_Mey\zcmu_appointment\node_modules\vant\es\stepper\index.js

 warning  in ./node_modules/Vant/es/utils/validate/system.js

There are multiple modules with names that only differ in casing.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
Use equal casing. Compare these module identifiers:
* D:\SYGT_Mey\zcmu_appointment\node_modules\Vant\es\utils\validate\system.js
    Used by 2 module(s), i. e.
    D:\SYGT_Mey\zcmu_appointment\node_modules\Vant\es\address-edit\Detail.js
* D:\SYGT_Mey\zcmu_appointment\node_modules\vant\es\utils\validate\system.js
    Used by 2 module(s), i. e.
    D:\SYGT_Mey\zcmu_appointment\node_modules\vant\es\address-edit\Detail.js

 warning  in ./node_modules/Vant/es/utils/vnodes.js

There are multiple modules with names that only differ in casing.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
Use equal casing. Compare these module identifiers:
* D:\SYGT_Mey\zcmu_appointment\node_modules\Vant\es\utils\vnodes.js
    Used by 2 module(s), i. e.
    D:\SYGT_Mey\zcmu_appointment\node_modules\Vant\es\mixins\relation.js
* D:\SYGT_Mey\zcmu_appointment\node_modules\vant\es\utils\vnodes.js
    Used by 2 module(s), i. e.
    D:\SYGT_Mey\zcmu_appointment\node_modules\vant\es\mixins\relation.js

警告代码是这样的,换了一个电脑,重新安装环境然后运行就出现这种警告了

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

苏佲洛 2022-09-19 13:12:44

记录,npm 中运行项目,警告:There are multiple modules with names that only differ in casing.

There are multiple modules with names that only differ in casing.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
Use equal casing. Compare these module identifiers:
***
**其中报错的功能模块为 node_modules 下引入的 node 包**
***
* D:\SYGT_Mey\zcmu_appointment\**node_modules**\Vant\es\utils\validate\system.js
    Used by 2 module(s), i. e.
    D:\SYGT_Mey\zcmu_appointment\**node_modules**\Vant\es\address-edit\Detail.js
* D:\SYGT_Mey\zcmu_appointment\**node_modules**\vant\es\utils\validate\system.js
    Used by 2 module(s), i. e.
    D:\SYGT_Mey\zcmu_appointment\**node_modules**\vant\es\address-edit\Detail.js

提示为 node_modules 中的包大小写不一致,考虑到昨天更换电脑设备,因此怀疑问题出现在安装环境中,删除了 node_modules 使用 cnpm iinstall 重新安装,然后就没有报错了

**总结:**
    如果项目中初始安装依赖包时使用的时 cnpm 那么之后的项目统一使用 cnpm 安装依赖项,如果使用 npm 或 taobao 镜像安装可能会出现莫名其妙的报错
温柔少女心 2022-09-19 13:12:44

确保你引用的模块大小写保持一致,如 Vuevue ,统一使用 Vue
https://stackoverflow.com/questions/47534267/webpack-there-are-multiple-modules-with-names-that-only-differ-in-casing-but

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文