BenoitZugmeyer / eslint-plugin-html

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

eslint is not loaded #73

Closed kaizer1v closed 7 years ago

kaizer1v commented 7 years ago

When I try to use eslint --ext html . from the shell - it throws the following error Also, I have installed another plugin called eslint-plugin-template from here. Not sure if the other plugin has any compatibility issues with your plugin, but here is the plugins section of the .eslintrc.json file

"plugins": [
    "template"
]

which causes the below error

eslint-plugin-html error: It seems that eslint is not loaded. If you think it is a bug, please file a report at https://github.com/BenoitZugmeyer/eslint-plugin-html/issues
Error: eslint-plugin-html error: It seems that eslint is not loaded. If you think it is a bug, please file a report at https://github.com/BenoitZugmeyer/eslint-plugin-html/issues
    at Object.<anonymous> (/usr/local/lib/node_modules/eslint-plugin-template/node_modules/eslint-plugin-html/src/index.js:48:9)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/eslint-plugin-template/eslint-plugin-template.js:2:12)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
BenoitZugmeyer commented 7 years ago

Thanks for the report. If you could post a package.json and a package-lock.json file, it would help me diagnosticate the issue.

CCing https://github.com/gramener/eslint-plugin-template/issues/1

Odaeus commented 7 years ago

I just installed eslint with eslint-plugin-html for the first time and receive the same error. I can reproduce with just initialising eslint in an empty dir, adding the plugin, and then attempting to run it. This gist contains the contents of the dir: https://gist.github.com/Odaeus/cdb3de717707826f1684cc0c448c4a6b

eslint-plugin-html error: It seems that eslint is not loaded. If you think it is a bug, please file a report at https://github.com/BenoitZugmeyer/eslint-plugin-html/issues
Error: eslint-plugin-html error: It seems that eslint is not loaded. If you think it is a bug, please file a report at https://github.com/BenoitZugmeyer/eslint-plugin-html/issues
    at iterateESLintModules (/usr/local/share/.config/yarn/global/node_modules/eslint-plugin-html/src/index.js:65:11)
BenoitZugmeyer commented 7 years ago

@Odaeus you didn't have a .eslintrc in your dir? also, it seems that you installed the html plugin globally (see the exception stacktrace): could you try the local node_modules/.bin/eslint command instead?

Odaeus commented 7 years ago

@BenoitZugmeyer oops I missed it because it's a hidden file. I've added the config to the gist now.

Ah yes, it works when I run the local command. Turns out I need to ensure everything is installed consistently as I think eslint was installed via sudo yarn global add but the plugin was without sudo. Matching them all up makes it work.

Thanks for your help!

BenoitZugmeyer commented 7 years ago

Closing due to lack of information.

kaizer1v commented 6 years ago

Actually this was fixed when changed the file permissions for .configstore folder.

You need to change ~/.config/configstore/ owner to your user name: sudo chown _username_ ~/.config/configstore

Typically you don't want to change to root but only sudo on your server. That should fix the permission issue problem.

Thank you.