Laravel8 安装报错Error: Cannot find module 'webpack/lib/rules/DescriptionDataMatcherRulePlugin'

发布于 2021-08-21  629 次阅读


详细报错:

[webpack-cli] Error: Cannot find module 'webpack/lib/rules/DescriptionDataMatcherRulePlugin'
Require stack:
- F:\phpstudy_pro\WWW\fuck.io\blog\node_modules\vue-loader\lib\plugin-webpack5.js
- F:\phpstudy_pro\WWW\fuck.io\blog\node_modules\vue-loader\lib\plugin.js
- F:\phpstudy_pro\WWW\fuck.io\blog\node_modules\vue-loader\lib\index.js
- F:\phpstudy_pro\WWW\fuck.io\blog\node_modules\laravel-mix\src\components\Vue.js
- F:\phpstudy_pro\WWW\fuck.io\blog\node_modules\laravel-mix\src\components\ComponentRegistrar.js
- F:\phpstudy_pro\WWW\fuck.io\blog\node_modules\laravel-mix\src\Mix.js
- F:\phpstudy_pro\WWW\fuck.io\blog\node_modules\laravel-mix\setup\webpack.config.js
- F:\phpstudy_pro\WWW\fuck.io\blog\node_modules\webpack-cli\lib\webpack-cli.js
- F:\phpstudy_pro\WWW\fuck.io\blog\node_modules\webpack-cli\lib\bootstrap.js
- F:\phpstudy_pro\WWW\fuck.io\blog\node_modules\webpack-cli\bin\cli.js
- F:\phpstudy_pro\WWW\fuck.io\blog\node_modules\webpack\bin\webpack.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (F:\phpstudy_pro\WWW\fuck.io\blog\node_modules\v8-compile-cache\v8-compile-cache.js:159:20)
    at Object.<anonymous> (F:\phpstudy_pro\WWW\fuck.io\blog\node_modules\vue-loader\lib\plugin-webpack5.js:6:42)
    at Module._compile (F:\phpstudy_pro\WWW\fuck.io\blog\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'F:\\phpstudy_pro\\WWW\\fuck.io\\blog\\node_modules\\vue-loader\\lib\\plugin-webpack5.js',
    'F:\\phpstudy_pro\\WWW\\fuck.io\\blog\\node_modules\\vue-loader\\lib\\plugin.js',
    'F:\\phpstudy_pro\\WWW\\fuck.io\\blog\\node_modules\\vue-loader\\lib\\index.js',
    'F:\\phpstudy_pro\\WWW\\fuck.io\\blog\\node_modules\\laravel-mix\\src\\components\\Vue.js',
    'F:\\phpstudy_pro\\WWW\\fuck.io\\blog\\node_modules\\laravel-mix\\src\\components\\ComponentRegistrar.js',
    'F:\\phpstudy_pro\\WWW\\fuck.io\\blog\\node_modules\\laravel-mix\\src\\Mix.js',
    'F:\\phpstudy_pro\\WWW\\fuck.io\\blog\\node_modules\\laravel-mix\\setup\\webpack.config.js',
    'F:\\phpstudy_pro\\WWW\\fuck.io\\blog\\node_modules\\webpack-cli\\lib\\webpack-cli.js',
    'F:\\phpstudy_pro\\WWW\\fuck.io\\blog\\node_modules\\webpack-cli\\lib\\bootstrap.js',
    'F:\\phpstudy_pro\\WWW\\fuck.io\\blog\\node_modules\\webpack-cli\\bin\\cli.js',
    'F:\\phpstudy_pro\\WWW\\fuck.io\\blog\\node_modules\\webpack\\bin\\webpack.js'

解决方法:

npm i vue-loader

然后重新npm run即可


天道酬勤