Cannot find module 'eslint/lib/formatters/stylish' when using ESLint ^6.0

See original GitHub issue

I am using “latest” on many deps in my package.json and today I started getting this error

 98% after emitting CopyPlugin

 ERROR  Failed to compile with 1 errors                                                                                                                              12:21:12 p.m.

Module build failed (from ./node_modules/@vue/cli-plugin-eslint/node_modules/eslint-loader/index.js):
Error: Cannot find module 'eslint/lib/formatters/stylish'
Require stack:
- ./node_modules/@vue/cli-plugin-eslint/node_modules/eslint-loader/index.js
- ./node_modules/loader-runner/lib/loadLoader.js
- ./node_modules/loader-runner/lib/LoaderRunner.js
- ./node_modules/@vue/cli-service/node_modules/webpack/lib/NormalModule.js
- ./node_modules/@vue/cli-service/node_modules/webpack/lib/NormalModuleFactory.js
- ./node_modules/@vue/cli-service/node_modules/webpack/lib/Compiler.js
- ./node_modules/@vue/cli-service/node_modules/webpack/lib/webpack.js
- ./node_modules/@vue/cli-service/lib/config/base.js
- ./node_modules/@vue/cli-service/lib/Service.js
- ./node_modules/@vue/cli-service/bin/vue-cli-service.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:610:15)
    at Function.Module._load (internal/modules/cjs/loader.js:526:27)
    at Module.require (internal/modules/cjs/loader.js:666:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at Object.module.exports (./node_modules/@vue/cli-plugin-eslint/node_modules/eslint-loader/index.js:196:28)

during yarn install:

eslint-plugin-vue > vue-eslint-parser@5.0.0" has unmet peer dependency "eslint@^5.0.0

this package.json was working fine before today:

  "devDependencies": {
    "@babel/core": "latest",
    "@vue/cli-plugin-babel": "next",
    "@vue/cli-plugin-e2e-cypress": "next",
    "@vue/cli-plugin-eslint": "next",
    "@vue/cli-plugin-pwa": "next",
    "@vue/cli-plugin-unit-mocha": "next",
    "@vue/cli-service": "next",
    "@vue/eslint-config-airbnb": "latest",
    "@vue/test-utils": "latest",
    "chai": "latest",
    "eslint": "latest",
    "eslint-plugin-vue": "latest",
    "sass": "latest",
    "sass-loader": "latest",
    "vue-template-compiler": "latest"
  }

and as of today it isn’t working anymore

I know using next/latest is not the best idea but this is only for development purposes

This works:

  "devDependencies": {
    "@babel/core": "latest",
    "@vue/cli-plugin-babel": "next",
    "@vue/cli-plugin-e2e-cypress": "next",
    "@vue/cli-plugin-eslint": "next",
    "@vue/cli-plugin-pwa": "next",
    "@vue/cli-plugin-unit-mocha": "next",
    "@vue/cli-service": "next",
    "@vue/eslint-config-airbnb": "latest",
    "@vue/test-utils": "latest",
    "chai": "latest",
    "eslint": "^5.0.0",
    "eslint-plugin-vue": "latest",
    "sass": "latest",
    "sass-loader": "latest",
    "vue-template-compiler": "latest"
  }

this does not:

  "devDependencies": {
    "@babel/core": "latest",
    "@vue/cli-plugin-babel": "next",
    "@vue/cli-plugin-e2e-cypress": "next",
    "@vue/cli-plugin-eslint": "next",
    "@vue/cli-plugin-pwa": "next",
    "@vue/cli-plugin-unit-mocha": "next",
    "@vue/cli-service": "next",
    "@vue/eslint-config-airbnb": "latest",
    "@vue/test-utils": "latest",
    "chai": "latest",
    "eslint": "^6.0.0",
    "eslint-plugin-vue": "latest",
    "sass": "latest",
    "sass-loader": "latest",
    "vue-template-compiler": "latest"
  }

Here is the printout of yarn list --depth=0 | grep eslint on the configuration that does not work

├─ @vue/cli-plugin-eslint@4.0.0-alpha.1
├─ @vue/eslint-config-airbnb@4.0.0
├─ babel-eslint@10.0.2
├─ eslint-config-airbnb-base@13.1.0
├─ eslint-import-resolver-node@0.3.2
├─ eslint-import-resolver-webpack@0.10.1
├─ eslint-loader@2.1.2
├─ eslint-module-utils@2.4.0
├─ eslint-plugin-cypress@2.2.1
├─ eslint-plugin-import@2.18.0
├─ eslint-plugin-vue@5.2.3
├─ eslint-restricted-globals@0.1.1
├─ eslint-scope@4.0.3
├─ eslint-utils@1.3.1
├─ eslint-visitor-keys@1.0.0
├─ eslint@6.0.1
├─ vue-eslint-parser@5.0.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

56reactions
vinayakkulkarnicommented, Jun 25, 2019

Yep, can confirm, issue happens with ESLint ^6.0, reverting back to version 5 resolves the issue.

- "eslint": "^6.0.1"
+ "eslint": "^5.16.0"
2reactions
rupamkhaitancommented, Jul 2, 2019

In the latest build of eslint 6.0.1 they moved the file path to below (so just override the path in your webpack)

// default value formatter: require(“eslint/lib/cli-engine/formatters/stylish”)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Cannot find module 'eslint/lib/formatters/stylish' #271
problem: eslint 5.x: eslint/lib/formatters/stylish eslint 6.x: ... I have a issue with ESLint 6.0.1 (Error: Cannot find module ...
Read more >
I cant start React app after deploy to GCP because of missing ...
I cant start React app after deploy to GCP because of missing module 'eslint/lib/formatters/stylish' ; with the word eslint from ; Remove package- ......
Read more >
Upgrade eslint-loader (!1700) · Merge requests - GitLab
When running the app with yarn start locally, the build currently throws an ... Error: Cannot find module 'eslint/lib/formatters/stylish' Require stack: ...
Read more >
Using globally installed "standard" package causes "Cannot ...
WEB-42388 Eslint after update - cannot detect installed modules ... code => Standard Code Style fails with "Cannot find module 'eslint-plugin-react'" error:.
Read more >
Bug#988307: eslint --init fails with "cannot find module 'inquirer'
formatters/stylish Error: Cannot find module 'text-table' Require stack: - /usr/share/nodejs/eslint/lib/formatters/stylish.js ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found