webstorm报错TypeError: this.cliEngine is not a constructor


点击Details在控制台会显示报错的位置



TypeError: this.cliEngine is not a constructor

    at ESLintPlugin.invokeESLint (/Applications/RubyMine.app/Contents/plugins/JavaScriptLanguage/languageService/eslint/bin/eslint-plugin.js:97:25)

    at ESLintPlugin.getErrors (/Applications/RubyMine.app/Contents/plugins/JavaScriptLanguage/languageService/eslint/bin/eslint-plugin.js:76:21)

    at ESLintPlugin.onMessage (/Applications/RubyMine.app/Contents/plugins/JavaScriptLanguage/languageService/eslint/bin/eslint-plugin.js:42:29)

    at Interface. (/Applications/RubyMine.app/Contents/plugins/JavaScriptLanguage/jsLanguageServicesImpl/js-language-service.js:105:39)

    at Interface.emit (events.js:189:13)

    at Interface._onLine (readline.js:290:10)

    at Interface._normalWrite (readline.js:433:12)

    at Socket.ondata (readline.js:149:10)

    at Socket.emit (events.js:189:13)

    at addChunk (_stream_readable.js:284:12)

Process finished with exit code -1



需要修改这个文件

/Applications/WebStorm.app/Contents/plugins/JavaScriptLanguage/languageService/eslint/bin/eslint-plugin.js

“Ctrl+F”填写“lib/cli-engine”找到

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

在后面添上‘.CLIEngine’,即

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

然后重启webstorm,OK,搞定。

你可能感兴趣的:(webstorm报错TypeError: this.cliEngine is not a constructor)