-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Error `Cannot find module 'eslint/lib/util/source-code' #1307
Comments
Is eslint a peer dep and dev dep of your plugin? It should not be a production dep. |
Just a peer dep of the plugin and a devDep of the test package consuming the plugin. |
hmm, what version of eslint is installed? |
|
So, that file exists: https://unpkg.com/eslint@5.15.3/lib/util/source-code.js Can you confirm that |
I have the custom plugin
Running
|
aha, that's the problem. when using npm link/yarn link, every single singleton must be linked as well - which includes eslint and every eslint plugin, and also inside all of these package folders - ie, there must only be one shared copy of eslint among the project, as well as all of the eslint-related dependencies. |
Ah ok, wondered if it might be something to do with linking. Thanks for the help! |
Per import-js/eslint-plugin-import#1307 (comment), there's probably some eslint@5 floating around...
Per import-js/eslint-plugin-import#1307 (comment), there's probably some eslint@5 floating around...
Per import-js/eslint-plugin-import#1307 (comment), there's probably some eslint@5 floating around...
Per import-js/eslint-plugin-import#1307 (comment), there's probably some eslint@5 floating around...
Per import-js/eslint-plugin-import#1307 (comment), there's probably some eslint@5 floating around...
This is what worked for me, just remove node_modules folder and do |
I had to upgrade all
|
Per import-js/eslint-plugin-import#1307 (comment), there's probably some eslint@5 floating around...
I am getting the same error as reported in #1265.
My setup is a little different though, I am creating a shareable plugin with config.
Reverting to
2.14.0
fixes the problem for me but that is not an proper solution going forward.I have all the dependencies, plugins/configs within my custom plugin and then eslint in the repo consuming the custom plugin so all plugins/configs should be using the same version of eslint as it is only installed once.
eslint-plugin-my-plugin
:The text was updated successfully, but these errors were encountered: