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

webstorm报错TypeError: this.cliEngine is not a constructor,第1张

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.<anonymous>(/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启动一个项目枣基时,提示“Switch language version to React JSX”

解决方法:file——setting——凳渗谨language &frameworks——JavaScript改为ReactJSX即喊李可


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/12507058.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-26
下一篇 2023-05-26

发表评论

登录后才能评论

评论列表(0条)

保存