webstorm eslint package path is not defined

有两种错误提示:

  1. TypeError: this.CliEngine is not a constructor
  2. packagePath is not defined

解决方法:
找到webstorm根目录,依次点开文件夹

安装目录\plugins\JavaScriptLanguage\languageService\eslint\bin\eslint-plugin.js

打开文件,找到下面的内容替换成:

1
2
3
4
// 注释下面这行
// this.cliEngine = require(packagePath + "lib/cli-engine").CLIEngine;
// 改为
this.cliEngine = require(this.basicPath + "lib/cli-engine").CLIEngine;

重启webstorm后,问题解决。

webstorm eslint package path is not defined

作者:有点东西

链接: https://www.youdiandongxi.com/article/webstorm-error1.html

协议:本文采用 CC BY-NC-SA 4.0 隐私协议,转载请注明出处!

评论区