解决关于:TypeError: Class constructor Model cannot be invoked without 'new'

时间:2017-11-08 20:39:19   收藏:0   阅读:4928

问题描述:在工作过程中出现 TypeError: Class constructor Model cannot be invoked without ‘new‘ 这个错误

以下是报错代码:

class Users extends father{

   constructor(data){
   super(data);
   }

   ····
}

版本信息

npm 5.0.3

node 8.9.0

错误原因:

es版本为 es2015 es5

解决方案:

打开 tsconfig.json文件

将es5 es2015 替换为es6 重新编译 

 

此随笔乃本人学习工作记录,如有疑问欢迎在下面评论,转载请标明出处。

如果对您有帮助请动动鼠标右下方给我来个赞,您的支持是我最大的动力。

原文:http://www.cnblogs.com/huangenai/p/7805907.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!