There are multiple modules with names that only differ in casing. 问题的一种解决方法

------------恢复内容开始------------

 WARNING  Compiled with 2 warnings

 warning  in ./node_modules/node-libs-browser/mock/process.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:
* C:\Users\coder\Source\Repos\project_name\views\node_modules\node-libs-browser\mock\process.js
    Used by 1 module(s), i. e.
    C:\Users\coder\Source\Repos\project_name\views\node_modules\axios\lib\defaults.js
* C:\Users\coder\source\repos\project_name\views\node_modules\node-libs-browser\mock\process.js
    Used by 1 module(s), i. e.
    C:\Users\coder\source\repos\project_name\views\node_modules\path-browserify\index.js

 warning  in ./node_modules/webpack/buildin/global.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:
* C:\Users\coder\Source\Repos\project_name\views\node_modules\webpack\buildin\global.js
    Used by 3 module(s), i. e.
    C:\Users\coder\Source\Repos\project_name\views\node_modules\vue\dist\vue.runtime.esm.js
* C:\Users\coder\source\repos\project_name\views\node_modules\webpack\buildin\global.js
    Used by 2 module(s), i. e.
    C:\Users\coder\source\repos\project_name\views\node_modules\sockjs-client\dist\sockjs.js

  

网上可以查到好多帖子,有说把 import 的 @ 和 ‘../../xxx’ 这两种路径描述方式统一的,还有说查找一下文件名大小写的。

不过这个问题应该都是在windows系统下做开发会出现,主要是路径的大小写问题,有的人帖子写的是自定义组件文件名的问题(不过这种情况下,大小写对不上应该会直接在控制台报错的),象我这样属于npm里的三方组件库。

后来我想了一下,我的代码换过一次位置,换到了 C:\Users\coder\Source\Repos  这个存在大写字母的路径下,于是我就想是否可能原因在这里。

所以我就在 C:\code\project_name 这个目录(除盘符全小写)下重新从git拖了一个项目过来,再运行,真就不报warning了。。。

大家全在小写路径下存代码应该就可以了,另外组件和文件名也建议全小写,省去各种因字母大小写产生的困扰,驼峰不了就用减号或下划线分隔。

------------恢复内容结束------------

快写完还没发的时候电脑死机了。。博客园的这个即时保存和恢复功能真是太香了!!

posted @ 2020-06-02 21:40  钻葛格  阅读(1272)  评论(0编辑  收藏  举报