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;
然后重啟開發工具。