H5W3
当前位置:H5W3 > 其他技术问题 > 正文

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

回答:

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 就可以了

回答:

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

回答:

其实Vue有类似的帖子 答案也就是不要用Gitbash 就是使用Window cmd就行了 帖子地址:RESOLVED There are multiple modules with names that only differ in casing

回答:

从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 …

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

评论 0

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址