BenoitZugmeyer / eslint-plugin-html

An ESLint plugin to extract and lint scripts from HTML files.
ISC License
430 stars 51 forks source link

Error: Failed to load plugin html: eslint-plugin-html error: It seems that eslint is not loaded #101

Closed songfs closed 6 years ago

songfs commented 6 years ago

Error Message:

Error: Failed to load plugin html: eslint-plugin-html error: It seems that eslint is not loaded.
If you think this is a bug, please file a report at https://github.com/BenoitZugmeyer/eslint-plugin-html/issues

In the report, please include *all* those informations:

* ESLint version: 4.19.1
* ESLint path: D:\workspace\test\node_modules\eslint\lib\api.js
* Plugin version: 4.0.5
* Plugin path: D:\workspace\test\node_modules\eslint-plugin-html\src
* NodeJS version: v8.11.3
* Content of your lock file (package-lock.json or yarn.lock)
* How did you run ESLint (via the command line? an editor plugin?)
* The following stack trace:
    Error
    at iterateESLintModules (D:\workspace\test\node_modules\eslint-plugin-html\src\index.js:94:7)
    at Object.<anonymous> (D:\workspace\test\node_modules\eslint-plugin-html\src\index.js:27:1)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.load (D:\workspace\test\node_modules\gulp-eslint\node_modules\eslint\lib\config\plugins.js:114:26)

    at iterateESLintModules (D:\workspace\test\node_modules\eslint-plugin-html\src\index.js:80:11)
    at Object.<anonymous> (D:\workspace\test\node_modules\eslint-plugin-html\src\index.js:27:1)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.load (D:\workspace\test\node_modules\gulp-eslint\node_modules\eslint\lib\config\plugins.js:114:26)

yarn.lock

eslint-plugin-html@^4.0.5:
  version "4.0.5"
  resolved "https://registry.yarnpkg.com/eslint-plugin-html/-/eslint-plugin-html-4.0.5.tgz#e8ec7e16485124460f3bff312016feb0a54d9659"
  dependencies:
    htmlparser2 "^3.8.2"
BenoitZugmeyer commented 6 years ago

Thank you for reporting this issue. It seems that you are using ESLint through gulp-eslint: can you tell me which version of gulp-eslint you are using (maybe send the whole yarn.lock file)?

songfs commented 6 years ago

@BenoitZugmeyer

the version : "gulp-eslint": "^2.0.0"

the yarn.lock file :

yarn.zip

BenoitZugmeyer commented 6 years ago

Ok, so there it is: gulp-eslint is using ESLint 2.13.1 internally (even if you have installed ESLint 4.19.1 yourself). Since eslint-plugin-html v4, the minimum supported ESLint version is 4.7. Two solutions: either upgrade gulp-eslint, or downgrad eslint-plugin-html to v3.