315920958 发表于 2020-3-1 16:37:45

前端项目npm run build报错

试了master分支,2.0.1到2.1.3各个tag。npm install 没有问题。npm run serve 也没问题。
执行 npm run build 就会报错:
⠋Building for production... ERRORTypeError: Class extends value undefined is not a constructor or null
TypeError: Class extends value undefined is not a constructor or null
    at Object.<anonymous> (/root/test/jeecg/node_modules/mini-css-extract-plugin/dist/CssDependency.js:12:46)
……
……

怀疑是自己电脑的npm依赖环境是不是有问题,于是找了一台新装的linux虚拟机,也不行。
以下是完整的运行命令:

# node -v
v12.16.1
# npm -v
6.13.4
#git clone --branch v2.1.3 https://github.com/zhangdaiscott/jeecg-boot.git
#cd jeecg-boot/ant-design-jeecg-vue
npm install
....(略,成功)
npm run build
...
> vue-antd-jeecg@2.0.1 build /Users/liruifan/log/test/jeecg-boot/ant-design-jeecg-vue
> vue-cli-service build
⠋Building for production... ERRORTypeError: Class extends value undefined is not a constructor or null
TypeError: Class extends value undefined is not a constructor or null
    at Object.<anonymous> (/Users/liruifan/log/test/jeecg-boot/ant-design-jeecg-vue/node_modules/mini-css-extract-plugin/dist/CssDependency.js:12:46)

请问如何解决呢?
你们没有遇到过这个问题吗?

dxxfire 发表于 2020-3-1 22:54:46

本帖最后由 dxxfire 于 2020-3-1 22:56 编辑

http://www.jeecg.org/forum.php?mod=viewthread&tid=7816&extra=page%3D1
第24个问题:24.前端项目报错

页: [1]
查看完整版本: 前端项目npm run build报错