Error: Cannot find module ‘webpack/lib/rules/DescriptionDataMatcherRulePlugin’ Require stack:

Total
0
Shares

I have webpack-cli installed on my laravel project. I don’t know why first of all we need it to run my vue app but this is causing an error:

When I run npm run dev or npm run hot

[webpack-cli] Error: Cannot find module 'webpack/lib/rules/DescriptionDataMatcherRulePlugin'
Require stack:
- C:UsersVirussDesktoptest-meme-librarymeme-librarynode_modulesvue-loaderlibplugin-webpack5.js
- C:UsersVirussDesktoptest-meme-librarymeme-librarynode_modulesvue-loaderlibplugin.js
- C:UsersVirussDesktoptest-meme-librarymeme-librarynode_modulesvue-loaderlibindex.js
- C:UsersVirussDesktoptest-meme-librarymeme-librarynode_moduleslaravel-mixsrccomponentsVue.js
- C:UsersVirussDesktoptest-meme-librarymeme-librarynode_moduleslaravel-mixsrccomponentsComponentRegistrar.js
- C:UsersVirussDesktoptest-meme-librarymeme-librarynode_moduleslaravel-mixsrcMix.js
- C:UsersVirussDesktoptest-meme-librarymeme-librarynode_moduleslaravel-mixsetupwebpack.config.js
- C:UsersVirussDesktoptest-meme-librarymeme-librarynode_moduleswebpack-clilibwebpack-cli.js
- C:UsersVirussDesktoptest-meme-librarymeme-librarynode_moduleswebpack-clilibbootstrap.js
- C:UsersVirussDesktoptest-meme-librarymeme-librarynode_moduleswebpack-clibincli.js
- C:UsersVirussDesktoptest-meme-librarymeme-librarynode_moduleswebpackbinwebpack.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:93:18)
    at Object.<anonymous> (C:UsersVirussDesktoptest-meme-librarymeme-librarynode_modulesvue-loaderlibplugin-webpack5.js:6:42)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Module.require (internal/modules/cjs/loader.js:974:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\Users\Viruss\Desktop\test-meme-library\meme-library\node_modules\vue-loader\lib\plugin-webpack5.js',
    'C:\Users\Viruss\Desktop\test-meme-library\meme-library\node_modules\vue-loader\lib\plugin.js',
    'C:\Users\Viruss\Desktop\test-meme-library\meme-library\node_modules\vue-loader\lib\index.js',
    'C:\Users\Viruss\Desktop\test-meme-library\meme-library\node_modules\laravel-mix\src\components\Vue.js',
    'C:\Users\Viruss\Desktop\test-meme-library\meme-library\node_modules\laravel-mix\src\components\ComponentRegistrar.js',
    'C:\Users\Viruss\Desktop\test-meme-library\meme-library\node_modules\laravel-mix\src\Mix.js',
    'C:\Users\Viruss\Desktop\test-meme-library\meme-library\node_modules\laravel-mix\setup\webpack.config.js',
    'C:\Users\Viruss\Desktop\test-meme-library\meme-library\node_modules\webpack-cli\lib\webpack-cli.js',
    'C:\Users\Viruss\Desktop\test-meme-library\meme-library\node_modules\webpack-cli\lib\bootstrap.js',
    'C:\Users\Viruss\Desktop\test-meme-library\meme-library\node_modules\webpack-cli\bin\cli.js',
    'C:\Users\Viruss\Desktop\test-meme-library\meme-library\node_modules\webpack\bin\webpack.js'
  ]
}

Vue is installed also vue-loader, can’t understand why it can’t find those files. Also, I looked at the node_modules everything is in there …


Solution

You need to update your vue-loader

npm update vue-loader

And if it is not installed, install it

npm i vue-loader

Source: StackOverflow.com

Leave a Reply

Your email address will not be published. Required fields are marked *