美文网首页
TypeError: this.CliEngine is not

TypeError: this.CliEngine is not

作者: 奔跑的痕迹 | 来源:发表于2020-04-11 12:38 被阅读0次

    vue cli3 项目老是提示TypeError: this.CliEngine is not a constructor这个,看着特别扭

    解决方法也不难,直接点击Details

    错误提示
    然后再点击,如下第一个文件链接
    控制台
    找到如下方法
    
      function ESLintPlugin(state) {
            this.filterSource = state.filterSource;
            this.additionalRulesDirectory = state.additionalRootDirectory;
            this.calcBasicPath(state.eslintPackagePath);
            this.version = this.readVersion();
            if (this.initError == null) {
                this.linter = require(this.basicPath + "lib/cli.js");
                this.options = require(this.basicPath + "lib/options");
                this.CliEngine = require(this.basicPath + "lib/cli-engine");
            }
        }
        
    

    this.CliEngine = require(this.basicPath + "lib/cli-engine"); 更改为 this.CliEngine = require(this.basicPath + "lib/cli-engine").CLIEngine;

    然后重启webstorm

    相关文章

      网友评论

          本文标题:TypeError: this.CliEngine is not

          本文链接:https://www.haomeiwen.com/subject/qnhymhtx.html