npm run dev 启动项目后报三个警告,百度查了一下也看不明白,求指点。

warning in ./~/vue-style-loader/lib/addStylesClient.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:

  • E:WebProjectUFAPPDYJJnode_modulesvue-style-loaderlibaddStylesClient.js

    Used by 4 module(s), i. e.
    E:\WebProject\UFAPP\DYJJ\node_modules\vue-style-loader\index.js!E:\WebProject\UFAPP\DYJJ\node_modules\css-loader\index.js?{"minimize":false,"sourceMap":false}!E:\WebProject\UFAPP\DYJJ\node_modules\vue-loader\lib\style-compiler\index.js?{"vue":true,"id":"data-v-f7c02f2c","scoped":false,"hasInlineConfig":false}!E:\WebProject\UFAPP\DYJJ\node_modules\vue-loader\lib\selector.js?type=styles&index=0!E:\WebProject\UFAPP\DYJJ\src\App.vue
  • E:WebProjectufappDYJJnode_modulesvue-style-loaderlibaddStylesClient.js

    Used by 1 module(s), i. e.
    E:\WebProject\UFAPP\DYJJ\node_modules\vue-style-loader\index.js!E:\WebProject\UFAPP\DYJJ\node_modules\css-loader\index.js??ref--4-1!E:\WebProject\ufapp\DYJJ\node_modules\.7.0.0@normalize.css\normalize.css
    

warning in ./~/css-loader/lib/css-base.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:

  • E:WebProjectUFAPPDYJJnode_modulescss-loaderlibcss-base.js

    Used by 4 module(s), i. e.
    E:\WebProject\UFAPP\DYJJ\node_modules\css-loader\index.js?{"minimize":false,"sourceMap":false}!E:\WebProject\UFAPP\DYJJ\node_modules\.2.0.0-rc.17@iview\dist\styles\iview.css
  • E:WebProjectufappDYJJnode_modulescss-loaderlibcss-base.js

    Used by 1 module(s), i. e.
    E:\WebProject\ufapp\DYJJ\node_modules\css-loader\index.js?{"minimize":false,"sourceMap":false}!E:\WebProject\ufapp\DYJJ\node_modules\.7.0.0@normalize.css\normalize.css
    

warning in ./~/vue-style-loader/lib/listToStyles.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:

  • E:WebProjectUFAPPDYJJnode_modulesvue-style-loaderliblistToStyles.js

    Used by 1 module(s), i. e.
    E:\WebProject\UFAPP\DYJJ\node_modules\vue-style-loader\lib\addStylesClient.js
  • E:WebProjectufappDYJJnode_modulesvue-style-loaderliblistToStyles.js

    Used by 1 module(s), i. e.
    E:\WebProject\ufapp\DYJJ\node_modules\vue-style-loader\lib\addStylesClient.js
阅读 27.5k
11 个回答

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.
使用唯一的写法

猜测是因为你的文件名和引用不一致,举个例,文件名是App.js,但是你引用的时候是写的app.js

已经是一致,但是不行,最后重启VS Code 就可以了

补充一种状况,如果引用的模块包含大写的,然后在多个地方引用,有的使用了大写,有的使用了小写,也会有类似的提示

新手上路,请多包涵

从npm下载的模块名字都是小写的,比如 vue,
正确的引入是import Vue from 'vue',如果你写成import Vue from 'Vue'就会提示警告。

打个比方,路径是E:\WebProject\ufapp\DYJJ\node_modules\vue-style-loader\lib\addStylesClient.js
文件目录改成小写即可解决。
E:\webproject\ufapp\dyjj\node_modules\vue-style-loader\lib\addStylesClient.js
因为linux严格区分大小写,而windows不区分。

新手上路,请多包涵

建议你所有引用的模块使用绝对的路径

也补充一种情况。vuex报这个错有一个可能是:在组件内引入mapGetter但是没有使用的时候vuex.esm.js会报这个错误。

补充一种情况,

我用的是hbuilder自带的命令端运行,一直报错,大小路径没问题, 看到这帖后。
我关了hbuilder的命令终端, 改用系统自带的终端启动, 一切正常。 内心不禁一万个 wtf ...

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
宣传栏