Laravel8安装Vue报DescriptionDataMatcherRulePlugin错误

作者: 温新

分类: 【Laravel】

阅读: 3393

时间: 2021-09-23 06:20:19

Laravel8.X使用vue时,遇到一个问题,为此进行记录一下。也有可能不使用vue遇到同样的问题。

composer require laravel/ui

php artisan ui vue --auth

npm install

// 会报错
npm run dev

当正常步骤使用vue时,执行npm run dev后报错,[webpack-cli] Error: Cannot find module 'webpack/lib/rules/DescriptionDataMatcherRulePlugin'Require stack:

Laravel8.x DescriptionDataMatcherRulePlugin'Require stack错误

报的具体错误如下:

[webpack-cli] Error: Cannot find module 'webpack/lib/rules/DescriptionDataMatcherRulePlugin'
Require stack:
- H:\phpstudy_pro\WWW\04_HyLaravelItem\2021\mauth\node_modules\vue-loader\lib\plugin-webpack5.js
- H:\phpstudy_pro\WWW\04_HyLaravelItem\2021\mauth\node_modules\vue-loader\lib\plugin.js
- H:\phpstudy_pro\WWW\04_HyLaravelItem\2021\mauth\node_modules\vue-loader\lib\index.js
- H:\phpstudy_pro\WWW\04_HyLaravelItem\2021\mauth\node_modules\laravel-mix\src\components\Vue.js
- H:\phpstudy_pro\WWW\04_HyLaravelItem\2021\mauth\node_modules\laravel-mix\src\components\ComponentRegistrar.js
- H:\phpstudy_pro\WWW\04_HyLaravelItem\2021\mauth\node_modules\laravel-mix\src\Mix.js
- H:\phpstudy_pro\WWW\04_HyLaravelItem\2021\mauth\node_modules\laravel-mix\setup\webpack.config.js
- H:\phpstudy_pro\WWW\04_HyLaravelItem\2021\mauth\node_modules\webpack-cli\lib\webpack-cli.js
- H:\phpstudy_pro\WWW\04_HyLaravelItem\2021\mauth\node_modules\webpack-cli\lib\bootstrap.js
- H:\phpstudy_pro\WWW\04_HyLaravelItem\2021\mauth\node_modules\webpack-cli\bin\cli.js
- H:\phpstudy_pro\WWW\04_HyLaravelItem\2021\mauth\node_modules\webpack\bin\webpack.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (H:\phpstudy_pro\WWW\04_HyLaravelItem\2021\mauth\node_modules\v8-compile-cache\v8-compile-cache.js:159:20)
    at Object.<anonymous> (H:\phpstudy_pro\WWW\04_HyLaravelItem\2021\mauth\node_modules\vue-loader\lib\plugin-webpack5.js:6:42)
    at Module._compile (H:\phpstudy_pro\WWW\04_HyLaravelItem\2021\mauth\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'H:\\phpstudy_pro\\WWW\\04_HyLaravelItem\\2021\\mauth\\node_modules\\vue-loader\\lib\\plugin-webpack5.js',
    'H:\\phpstudy_pro\\WWW\\04_HyLaravelItem\\2021\\mauth\\node_modules\\vue-loader\\lib\\plugin.js',
    'H:\\phpstudy_pro\\WWW\\04_HyLaravelItem\\2021\\mauth\\node_modules\\vue-loader\\lib\\index.js',
    'H:\\phpstudy_pro\\WWW\\04_HyLaravelItem\\2021\\mauth\\node_modules\\laravel-mix\\src\\components\\Vue.js',
    'H:\\phpstudy_pro\\WWW\\04_HyLaravelItem\\2021\\mauth\\node_modules\\laravel-mix\\src\\components\\ComponentRegistrar.js',
    'H:\\phpstudy_pro\\WWW\\04_HyLaravelItem\\2021\\mauth\\node_modules\\laravel-mix\\src\\Mix.js',
    'H:\\phpstudy_pro\\WWW\\04_HyLaravelItem\\2021\\mauth\\node_modules\\laravel-mix\\setup\\webpack.config.js',
    'H:\\phpstudy_pro\\WWW\\04_HyLaravelItem\\2021\\mauth\\node_modules\\webpack-cli\\lib\\webpack-cli.js',
    'H:\\phpstudy_pro\\WWW\\04_HyLaravelItem\\2021\\mauth\\node_modules\\webpack-cli\\lib\\bootstrap.js',
    'H:\\phpstudy_pro\\WWW\\04_HyLaravelItem\\2021\\mauth\\node_modules\\webpack-cli\\bin\\cli.js',
    'H:\\phpstudy_pro\\WWW\\04_HyLaravelItem\\2021\\mauth\\node_modules\\webpack\\bin\\webpack.js'
  ]
}
npm ERR! code ELIFECYCLE

DescriptionDataMatcherRulePlugin错误的解决方法

// 升级 vue-loader解决错误
npm update vue-loader

参考连接https://learnku.com/articles/59779

请登录后再评论