problem with installing Laravel 8 and vue.js Error: Cannot find module

I recently got this error whenever I install vue in laravel using the following commands:

composer require laravel/UI
PHP artisan up vue
php artisan ui vue --auth
npm install && npm run dev

I get this new error and its the first time that happened to me:

 Error: Cannot find module 'webpack/lib/rules/DescriptionDataMatcherRulePlugin'
Require stack:
- C:wamp64wwwprojectsquizappnode_modulesvue-loaderlibplugin-webpack5.js
- C:wamp64wwwprojectsquizappnode_modulesvue-loaderlibplugin.js
- C:wamp64wwwprojectsquizappnode_modulesvue-loaderlibindex.js
- C:wamp64wwwprojectsquizappnode_moduleslaravel-mixsrccomponentsVue.js
- C:wamp64wwwprojectsquizappnode_moduleslaravel-mixsrccomponentsComponentRegistrar.js
- C:wamp64wwwprojectsquizappnode_moduleslaravel-mixsrcMix.js
- C:wamp64wwwprojectsquizappnode_moduleslaravel-mixsetupwebpack.config.js
- C:wamp64wwwprojectsquizappnode_moduleswebpack-clilibwebpack-cli.js
- C:wamp64wwwprojectsquizappnode_moduleswebpack-clilibbootstrap.js
- C:wamp64wwwprojectsquizappnode_moduleswebpack-clibincli.js
- C:wamp64wwwprojectsquizappnode_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 (C:wamp64wwwprojectsquizappnode_modulesv8-compile-cachev8-compile-cache.js:159:20)
    at Object.<anonymous> (C:wamp64wwwprojectsquizappnode_modulesvue-loaderlibplugin-webpack5.js:6:42)
    at Module._compile (C:wamp64wwwprojectsquizappnode_modulesv8-compile-cachev8-compile-cache.js:192:30)
    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:14)
    at Module.require (internal/modules/cjs/loader.js:974:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:wamp64wwwprojectsquizappnode_modulesvue-loaderlibplugin-webpack5.js',
    'C:wamp64wwwprojectsquizappnode_modulesvue-loaderlibplugin.js',
    'C:wamp64wwwprojectsquizappnode_modulesvue-loaderlibindex.js',
    'C:wamp64wwwprojectsquizappnode_moduleslaravel-mixsrccomponentsVue.js',
    'C:wamp64wwwprojectsquizappnode_moduleslaravel-mixsrccomponentsComponentRegistrar.js',
    'C:wamp64wwwprojectsquizappnode_moduleslaravel-mixsrcMix.js',
    'C:wamp64wwwprojectsquizappnode_moduleslaravel-mixsetupwebpack.config.js',
    'C:wamp64wwwprojectsquizappnode_moduleswebpack-clilibwebpack-cli.js',
    'C:wamp64wwwprojectsquizappnode_moduleswebpack-clilibbootstrap.js',
    'C:wamp64wwwprojectsquizappnode_moduleswebpack-clibincli.js',
    'C:wamp64wwwprojectsquizappnode_moduleswebpackbinwebpack.js'
  ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @ watch: `mix watch`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @ watch script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:UserszzzabAppDataRoamingnpm-cache_logs21-08-05T07_08_51_267Z-debug.log

and I tried to make a new laravel project and didn’t work.

Solution :

First run :

npm i vue-loader

After that run :

npm run dev

Leave a comment

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