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

Cannot find eslint formatters module #1324

Open
YodasWs opened this issue Jun 9, 2021 · 3 comments
Open

Cannot find eslint formatters module #1324

YodasWs opened this issue Jun 9, 2021 · 3 comments

Comments

@YodasWs
Copy link

YodasWs commented Jun 9, 2021

I am trying to run sass-lint through gulp-sass using eslint 6.0.1, but I get the following error message:

Error: Cannot find module 'eslint/lib/formatters/stylish'
Require stack:
- node_modules/sass-lint/index.js
- node_modules/gulp-sass-lint/index.js
- node_modules/gulp-load-plugins/index.js
- gulpfile.js
- /usr/local/lib/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0/index.js
- /usr/local/lib/node_modules/gulp/node_modules/gulp-cli/index.js
- /usr/local/lib/node_modules/gulp/bin/gulp.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Function.sassLint.format (node_modules/sass-lint/index.js:257:19)
    at Function.sassLint.outputResults (node_modules/sass-lint/index.js:276:26)
    at DestroyableTransform._transform (node_modules/gulp-sass-lint/index.js:77:12)
    at DestroyableTransform.Transform._read (node_modules/readable-stream/lib/_stream_transform.js:184:10)
    at DestroyableTransform.Transform._write (node_modules/readable-stream/lib/_stream_transform.js:172:83)
    at doWrite (node_modules/readable-stream/lib/_stream_writable.js:428:64)

I can run eslint through gulp-eslint without hitting this error.

@thomas-p-wilson
Copy link

For anybody stopping by with the same issue, based on a similar issue here, it seems that the problem is sass-lint's dependence upon an older version of ESLint. I tried downgrading from ESLint 7.32.0 to 5.16.0 and sass-lint worked. Not a workable solution for me, but a fun little experiment nontheless.

@thomas-p-wilson
Copy link

FWIW, I switched to Stylelint, at least for the time being. Last release was 20 days ago at time of writing...

@AMoo-Miki
Copy link

Create .sass-lint.yml if you don't already have one and add this to it:

options:
  formatter: '../cli-engine/formatters/stylish'

Then force sass-lint to use an updated eslint with one of these

  • Yarn: Add an entry to your resolutions with "sass-lint/eslint": "^8.42.0" or "**/eslint": "^8.42.0".
  • NPM: Add an entry to your overrides with
      "sass-lint": {
        "eslint": "^8.42.0"
      }
    

I have tested the Yarn solution but not the NPM one.

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

3 participants