Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nuxt installation error : Rule can only have one resource source (provided resource and test + include + exclude)

I successfully installed Vuejs and Nodejs but got a problem when installing Nuxtjs. This is what I get. I already asked some friends but it didn't work. Thanks for your help ! :)

Error : Rule can only have one resource source (provided resource and test + include + exclude)

Rule can only have one resource source (provided resource and test + include + exclude) in {
  "use": [
    {
      "loader": "C:\\Users\\User\\Desktop\\JS\\my-first-project\\node_modules\\babel-loader\\lib\\index.js",
      "options": {
        "configFile": false,
        "babelrc": false,
        "cacheDirectory": true,
        "envName": "server",
        "presets": [
          [
            "C:\\Users\\User\\Desktop\\JS\\my-first-project\\node_modules\\@nuxt\\babel-preset-app\\src\\index.js",
            {
              "corejs": {
                "version": 3
              }
            }
          ]
        ]
      },
      "ident": "clonedRuleSet-30[0].rules[0].use[0]"
    }
  ]
}

  "use": [
  {
  "loader": "C:\\Users\\User\\Desktop\\JS\\my-first-project\\node_modules\\babel-loader\\lib\\index.js",
  "options": {
  "configFile": false,
  "babelrc": false,
  "cacheDirectory": true,
  "envName": "server",
  "presets": [
  [
  "C:\\Users\\User\\Desktop\\JS\\my-first-project\\node_modules\\@nuxt\\babel-preset-app\\src\\index.js",
  {
  "corejs": {
  "version": 3
  }
  }
  ]
  ]
  },
  "ident": "clonedRuleSet-30[0].rules[0].use[0]"
  }
  ]
  }
  at checkResourceSource (node_modules\@nuxt\webpack\node_modules\webpack\lib\RuleSet.js:167:11)
  at Function.normalizeRule (node_modules\@nuxt\webpack\node_modules\webpack\lib\RuleSet.js:198:4)
  at node_modules\@nuxt\webpack\node_modules\webpack\lib\RuleSet.js:110:20
  at Array.map (<anonymous>)
  at Function.normalizeRules (node_modules\@nuxt\webpack\node_modules\webpack\lib\RuleSet.js:109:17)
  at new RuleSet (node_modules\@nuxt\webpack\node_modules\webpack\lib\RuleSet.js:104:24)
  at new NormalModuleFactory (node_modules\@nuxt\webpack\node_modules\webpack\lib\NormalModuleFactory.js:115:18)
  at Compiler.createNormalModuleFactory (node_modules\@nuxt\webpack\node_modules\webpack\lib\Compiler.js:636:31)
  at Compiler.newCompilationParams (node_modules\@nuxt\webpack\node_modules\webpack\lib\Compiler.js:653:30)
  at Compiler.compile (node_modules\@nuxt\webpack\node_modules\webpack\lib\Compiler.js:661:23)
  at node_modules\@nuxt\webpack\node_modules\webpack\lib\Watching.js:77:18
  at AsyncSeriesHook.eval [as callAsync] (eval at create (node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:22:1)
  at AsyncSeriesHook.lazyCompileHook (node_modules\tapable\lib\Hook.js:154:20)
  at Watching._go (node_modules\@nuxt\webpack\node_modules\webpack\lib\Watching.js:41:32)
  at node_modules\@nuxt\webpack\node_modules\webpack\lib\Watching.js:33:9
  at Compiler.readRecords (node_modules\@nuxt\webpack\node_modules\webpack\lib\Compiler.js:529:11)

like image 440
tujoker27 Avatar asked Oct 31 '20 09:10

tujoker27


1 Answers

npm i -D webpack@^4.46.0 try this, it worked for me.

like image 198
saif Avatar answered Oct 26 '22 22:10

saif