Webstorm报错TypeError: this.CliEngine is not a constructor

tech2023-02-21  92

问题原因:

eslint版本为6.x 与webstorm的eslint插件版本不一致

解决方法:

1. 点击报错右侧的 detail

2. 找到第25行左右的

this.cliEngine = require(this.basicPath + "lib/cli-engine");

修改为

if (typeof require(this.basicPath + "lib/cli-engine") === 'function') { this.cliEngine = require(this.basicPath + "lib/cli-engine"); } else { this.cliEngine = require(this.basicPath + "lib/cli-engine").CLIEngine; }

3. webstorm全部关闭, 重新启动

最新回复(0)