TypeError: this.CliEngine is not a constructor


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;

然后重啟開發工具。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM