【问题标题】:Nuxt VueJS There are multiple modules with names that only differ in casingNuxt VueJS 有多个模块名称只是大小写不同
【发布时间】:2019-09-03 20:50:41
【问题描述】:

nuxtJS在编译时出错,谷歌没有帮助,它写的是当声明大写字母发生时,我直接在node_modules中得到错误,而不是在我的组件中

    [HMR] bundle 'client'
has 6 warnings
vendors.app.js: 47737. / node_modules / base64 - js / index.jsThere 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: \ dashboard\ node_modules\ base64 - js\ index.js Used by 1 module(s), i.e.C: \ dashboard\ node_modules\ buffer\ index.js * C: \ dashboard\ node_modules\ base64 - js\ index.js Used by 1 module(s), i.e.C: \ dashboard\ node_modules\ buffer\ index.js. / node_modules / buffer / index.jsThere 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: \ dashboard\ node_modules\ buffer\ index.js Used by 3 module(s), i.e.C: \ dashboard\ node_modules\ jszip\ lib\ support.js * C: \ dashboard\ node_modules\ buffer\ index.js Used by 2 module(s), i.e.C: \ dashboard\ node_modules\ core - util - is\ lib\ util.js. / node_modules / ieee754 / index.jsThere 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: \ dashboard\ node_modules\ ieee754\ index.js Used by 1 module(s), i.e.C: \ dashboard\ node_modules\ buffer\ index.js * C: \ dashboard\ node_modules\ ieee754\ index.js Used by 1 module(s), i.e.C: \ dashboard\ node_modules\ buffer\ index.js. / node_modules / isarray / index.jsThere 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: \ dashboard\ node_modules\ isarray\ index.js Used by 1 module(s), i.e.C: \ dashboard\ node_modules\ buffer\ index.js * C: \ dashboard\ node_modules\ isarray\ index.js Used by 2 module(s), i.e.C: \ dashboard\ node_modules\ readable - stream\ lib\ _stream_readable.js. / node_modules / process / browser.jsThere 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: \ dashboard\ node_modules\ process\ browser.js Used by 2 module(s), i.e.C: \ dashboard\ node_modules\ setimmediate\ setImmediate.js * C: \ dashboard\ node_modules\ process\ browser.js Used by 2 module(s), i.e.C: \ dashboard\ node_modules\ readable - stream\ lib\ _stream_readable.js. / node_modules / webpack / buildin / global.jsThere 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: \ dashboard\ node_modules\ webpack\ buildin\ global.js Used by 8 module(s), i.e.C: \ dashboard\ node_modules\ babel - loader\ lib\ index.js ? ? ref--2 - 0!C : \ dashboard\.nuxt\ client.js * C : \ dashboard\ node_modules\ webpack\ buildin\ global.js Used by 4 module(s), i.e.C: \ dashboard\ node_modules\ readable - stream\ lib\ _stream_writable.js

有人有想法吗?

我的 nuxt.config.js

const pkg = require("./package");

const VuetifyLoaderPlugin = require("vuetify-loader/lib/plugin");

module.exports = {
  mode: "spa",
  head: {
    title: "Vue Template",
  },      
  css: [
    "~/assets/style/theme.styl",
    "~/assets/style/app.styl",
    "font-awesome/css/font-awesome.css",
    "roboto-fontface/css/roboto/roboto-fontface.css"
  ],
  plugins: [
    "~/plugins/vuetify",
    "~/plugins/vee-validate",
    "~/plugins/dxdatagrid",
    "~/plugins/vue-notifications"
  ],
  modules: [],
  build: {
    vendor: ["axios", "vuetify", "vue-notifications", "mini-toastr"],
    transpile: ["vuetify/lib"],
    plugins: [new VuetifyLoaderPlugin()],   
    extend(config, ctx) {}
  }      
};

【问题讨论】:

  • 你试过删除锁定文件和节点模块并重新安装吗?
  • 我当然试过了

标签: javascript node.js vue.js nuxt.js


【解决方案1】:

如果您在不同位置导入大小写不同的相同文件,则会发生错误。 例如;- 下面我正在导入相同的组件“AppControlInput”,但“ui”大写有所不同。在第一种情况下,'ui' 是小写,而在其他情况下,'ui' 是大写。

  1. 从“~/components/ui/AppControlInput”导入 AppControlInput;
  2. 从“~/components/UI/AppControlInput”导入 AppControlInput;

只要确保您在导入组件的每个地方都有相同的大小写。

【讨论】:

    猜你喜欢
    • 2021-05-14
    • 1970-01-01
    • 2018-12-16
    • 2018-01-08
    • 2018-05-12
    • 1970-01-01
    • 2020-04-16
    • 2017-06-18
    • 2021-09-17
    相关资源
    最近更新 更多