一、问题描述

执行 npm run build:prod


 ERROR  TypeError: Class extends value undefined is not a constructor or null
TypeError: Class extends value undefined is not a constructor or null
    at Object.<anonymous> (C:\Users\司超龙\IdeaProjects\vue\base_education_vue\base_education_third_3.0+\grass-roots teaching system\node_modules\mini-css-extract-plugin\dist\CssDependency.js:12:46)
    at Module._compile (internal/modules/cjs/loader.js:1063: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)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (C:\Users\司超龙\IdeaProjects\vue\base_education_vue\base_education_third_3.0+\grass-roots teaching system\node_modules\mini-css-extract-plugin\dist\index.js:12:45)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vue-admin-template@4.4.0 build:prod: `vue-cli-service build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vue-admin-template@4.4.0 build:prod 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:\Users\司超龙\AppData\Roaming\npm-cache\_logs\2021-03-26T13_04_34_482Z-debug.log

执行num run build:prod 报错,但是npm run dev没问题

二、解决

TypeError: Class extends value undefined is not a constructor or null at Object.<anonymous> (C:\Users\司超龙\IdeaProjects\vue\base_education_vue\base_education_third_3.0+\grass-roots teaching system\node_modules\mini-css-extract-plugin\dist\CssDependency.js:12:46)

CssDependency的问题,依赖包不兼容

执行npm add webpack@4.5.0,解决

Logo

前往低代码交流专区

更多推荐