search

Home  >  Q&A  >  body text

TypeError occurs when using eslint-loader in VueJS project: eslint.CLIEngine is not a constructor

I'm starting a new VueJS project in WebStorm. I created a new VueJS project, upgraded NPM, added Vuetify and after starting the server it threw this error:

ERROR  Failed to compile with 1 errors                                                                                                                                                                          11:34:19 AM

Module build failed (from ./node_modules/@vue/cli-plugin-eslint/node_modules/eslint-loader/index.js):
TypeError: eslint.CLIEngine is not a constructor
    at Object.module.exports (/home/milano/WebstormProjects/xxx/node_modules/@vue/cli-plugin-eslint/node_modules/eslint-loader/index.js:223:27)

How can I solve this problem? Should I downgrade to eslint?

P粉771233336P粉771233336303 days ago813

reply all(1)I'll reply

  • P粉543344381

    P粉5433443812024-03-26 17:05:30

    ESLint update 2019.1.3 resolves this issue. View this content

    You may need:

    • Upgrade your IDE to get the latest version of ESLint

    • Or upgrade ESLint

    • Alternatively, here there is a hack that involves updating how es-lint has been imported. For example:

      Change

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

      to

      this.CliEngine = require(this.basicPath).CLIEngine;

    reply
    0
  • Cancelreply