Class extends value undefined is not a constructor or null

cnpm run build 的时候报错,如下:

加载应用:voiceSpAvailable
加载应用:wechatTemplateList
 WARN  "baseUrl" option in vue.config.js is deprecated now, please use "publicPath" instead.

-  Building for production... ERROR  TypeError: Class extends value undefined is not a constructor or null
TypeError: Class extends value undefined is not a constructor or null
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.

很郁闷,这个文件根本就不是我的啊,有半毛钱关系???

这里讲明下,最好使用 cnpm, 因为python 有个npm 。所以当你使用 npm 的时候很可能会冲突。像我使用 npm install 的时候就抛出个python2的异常。

 

接着讲这个错。

百度了下 ,比较有用的一篇 : https://blog.csdn.net/u013938484/article/details/106259913

但是!!!!

webpack -v : 4.44.1     这么高。继续,

webpack-cli -v  : 3.3.12

初步判断两个版本不兼容。

升级下webpack-cli 的版本,不知道版本,就用下面的

npm add webpack-cli@latest --registry=https://registry.npm.taobao.org -g

npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN [email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.

+ [email protected]
updated 1 package in 12.428s

webpack-cli -v :3.3.12 

看来升级失败!!

注意下  [email protected] but none is installed   。需要的是4.x.x  ,说明webpack太高了

npm add [email protected] --registry=https://registry.npm.taobao.org -g  
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":"<8.10.0"} (current: {"node":"12.18.3","npm":"6.14.7"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]

npm ERR! Maximum call stack size exceeded

npm ERR! A complete log of this run can be found in:
npm ERR! 

失败!!,注意到一行:

notsup Not compatible with your version of node/npm: [email protected]

继续:

cnpm add watchpack-chokidar2@latest --registry=https://registry.npm.taobao.org -g

虽然报错了。不过再次build 成功了。所以可能是缺少了  watchpack-chokidar2  。解决

你可能感兴趣的:(错误全集)