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 module 'eslint-plugin-import' #1081

Closed
zeke opened this issue Feb 27, 2018 · 5 comments

Comments

@zeke
Copy link
Contributor

commented Feb 27, 2018

standard: Unexpected linter output:
Error: Failed to load plugin import: Cannot find module 'eslint-plugin-import'
Referenced from: /home/travis/build/electron/electronjs.org/node_modules/standard/eslintrc.json
    at Function.Module._resolveFilename (module.js:538:15)
    at Function.resolve (internal/module.js:18:19)
    at Plugins.load (/home/travis/build/electron/electronjs.org/node_modules/eslint/lib/config/plugins.js:106:29)
    at Array.forEach (<anonymous>)
    at Plugins.loadAll (/home/travis/build/electron/electronjs.org/node_modules/eslint/lib/config/plugins.js:146:21)
    at loadFromDisk (/home/travis/build/electron/electronjs.org/node_modules/eslint/lib/config/config-file.js:492:35)
    at load (/home/travis/build/electron/electronjs.org/node_modules/eslint/lib/config/config-file.js:550:20)
    at configExtends.reduceRight (/home/travis/build/electron/electronjs.org/node_modules/eslint/lib/config/config-file.js:421:36)
    at Array.reduceRight (<anonymous>)
    at applyExtends (/home/travis/build/electron/electronjs.org/node_modules/eslint/lib/config/config-file.js:403:28)
If you think this is a bug in `standard`, open an issue: https://github.com/standard/standard/issues
@feross

This comment has been minimized.

Copy link
Member

commented Feb 28, 2018

This is super odd. We depend on it in package.json here.

I just cloned the branch and tested locally with the exact same version of Node and npm and it worked fine.

I merged master into that PR branch and re-triggered a build. My guess is that it's a race condition npm bug. We'll see if that fixes it.

@feross

This comment has been minimized.

Copy link
Member

commented Feb 28, 2018

Didn't work. I'm stumped. npm is not installing the deps:

screen shot 2018-02-27 at 8 50 27 pm

@zkat Do you have any ideas about this? Thanks :)

@zkat

This comment has been minimized.

Copy link

commented Feb 28, 2018

I'll look at it in more detail tomorrow but: this looks like it's the peerdep hoisting issue. You'll likely have to manually install the missing peerdep at the top level.

tl:dr: npm knows not to hoist peerdeps in some situations but then it turns out it hoists the thing that requires that peerdep. This is not really trivial to fix because it needs a big change to the installer.

But a workaround is that you can just install a matching version of es-plugin-import at the top level and the thing that needs it will now, correctly, have a copy of it.

This bug, afaik, has been around pretty much since npm@3.

@zeke

This comment has been minimized.

Copy link
Contributor Author

commented Mar 15, 2018

Closing, as this appears to have been (perhaps indirectly) resolved in standard@11.0.1

See electron/electronjs.org#1209

@zeke zeke closed this Mar 15, 2018

@feross

This comment has been minimized.

Copy link
Member

commented Mar 17, 2018

@zeke Nice to hear!

@lock lock bot locked as resolved and limited conversation to collaborators Jun 15, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
3 participants
You can’t perform that action at this time.