Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug:TypeError: eslint.CLIEngine is not a constructor #6798

Open
kaiyu-tech opened this issue Oct 31, 2021 · 1 comment
Open

Bug:TypeError: eslint.CLIEngine is not a constructor #6798

kaiyu-tech opened this issue Oct 31, 2021 · 1 comment

Comments

@kaiyu-tech
Copy link

Version

4.5.15

Environment info

  System:
    OS: macOS 11.6
    CPU: (4) x64 Intel(R) Core(TM) i5-4308U CPU @ 2.80GHz
  Binaries:
    Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node
    Yarn: 1.22.15 - /usr/local/bin/yarn
    npm: 8.1.2 - ~/.nvm/versions/node/v16.13.0/bin/npm
  Browsers:
    Chrome: 95.0.4638.54
    Edge: Not Found
    Firefox: Not Found
    Safari: 15.1
  npmGlobalPackages:
    @vue/cli: 4.5.15

Steps to reproduce

  1. run npm install -g @vue/cli to install the Vue CLI globally.
  2. Run vue create my-project to create the project.
  3. Run cd my-project and navigate to the directory where the project you created is located.
  4. Run npm audit fix --force because you will get a message that there is a vulnerability problem during installation.
  5. However, I get a message that the vulnerability issue cannot be resolved.
  6. Ignore the vulnerability issue for now and run npm run serve.
  7. TypeError: eslint.CLIEngine is not a constructor is raised.
$ npm install -g @vue/cli
$ vue create my-project
$ cd my-project
$ npm audit fix --force
$ npm run serve
$ npm run serve

> my-project@0.1.0 serve
> vue-cli-service serve

 INFO  Starting development server...
98% after emitting CopyPlugin

 ERROR  Failed to compile with 1 errors                                                                         19:48:55

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 (~/work/oss-gate/my-project/node_modules/@vue/cli-plugin-eslint/node_modules/eslint-loader/index.js:223:27)

You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.

What is expected?

It seems that the problem has already been fixed in the dev branch (vuejs/vue-cli#6714), but I don't think the fix has been applied to the v4 branch.
Is is possible to backport that fix to v4 branch?

What is actually happening?

TypeError: eslint.CLIEngine is not a constructor is raised.


Supplementary information

If you ignore the vulnerability issue message and don't run npm audit fix --force, you won't get an error when you run npm run serve.

@blacelle
Copy link

blacelle commented Oct 31, 2021

This relates with ESLint8

#6759

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants