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

Error: Failed to load plugin import: Cannot find module 'es6-set' #1115

Closed
DJviolin opened this issue Oct 9, 2016 · 8 comments
Closed

Error: Failed to load plugin import: Cannot find module 'es6-set' #1115

DJviolin opened this issue Oct 9, 2016 · 8 comments
Labels

Comments

@DJviolin
Copy link

DJviolin commented Oct 9, 2016

I'm getting this error with a globally installed eslint and Node 7 Nightly on Windows:

The error message in Atom editor:

Error: Failed to load plugin import: Cannot find module 'es6-set' Referenced from: C:\Users\Lanti\AppData\Roaming\npm\node_modules\eslint-config-airbnb\node_modules\eslint-config-airbnb-base\index.js Referenced from: airbnb Referenced from: C:\www\node\lantosistvan.eslintrc.js
Error: Failed to load plugin import: Cannot find module 'es6-set'
Referenced from: C:\Users\Lanti\AppData\Roaming\npm\node_modules\eslint-config-airbnb\node_modules\eslint-config-airbnb-base\index.js
Referenced from: airbnb
Referenced from: C:\www\node\lantosistvan\.eslintrc.js
    at Function.Module._resolveFilename (module.js:339:15)
    at Function.Module._load (module.js:290:25)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (C:\Users\Lanti\AppData\Roaming\npm\node_modules\eslint-plugin-import\lib\rules\max-dependencies.js:5:15)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)

Node version: v7.0.0-test2016100609987d242b
NPM version: 3.10.8

I think these are related issues:
#465
walmartlabs/eslint-config-defaults#43
import-js/eslint-plugin-import#611
import-js/eslint-plugin-import#604

@DJviolin
Copy link
Author

DJviolin commented Oct 9, 2016

Looks like installing es6-set globally solving it. Missing dependency?

@ljharb
Copy link
Collaborator

ljharb commented Oct 9, 2016

I'd recommend not installing anything globally - if you do, I think you'd need to manually cd into the global location where eslint-config-airbnb is installed, and manually install the peer dependencies.

It's best to install everything locally, only.

@DJviolin
Copy link
Author

DJviolin commented Oct 9, 2016

Is there a way to install it locally and use eslint for Atom, Sublime Text? I'm using the airbnb standard for color linting in GUI editors.

@ljharb
Copy link
Collaborator

ljharb commented Oct 9, 2016

Yes, both of those editors can be configured to look in node_modules/.bin.

@DJviolin
Copy link
Author

DJviolin commented Oct 9, 2016

If I understand, I should install airbnb standard inside one of my projects, then I set the eslint executible path to this local install in Sublime Text / Atom?

Maybe I just create a new node project which contains all of the eslint, airbnb standard related stuff and I set this eslint's path to the GUI editors? Kinda like a .dotfiles repo, but only for local installs for GUI editor dependencies?

@ljharb
Copy link
Collaborator

ljharb commented Oct 9, 2016

Yes, I'm suggesting the former.

You could certainly do the latter but I don't think any project should be linted unless a developer who cloned the project on another machine can run npm install and be able to lint it the same as you - in other words, literally anything you run on your project should be in package.json.

@Arcanemagus
Copy link

@DJviolin assuming you are using the linter-eslint package in Atom, you shouldn't need to set anything. It should detect the locations for you if you have everything installed locally in the project.

The latter actually won't work inside Atom, at least not without modifying the code of the package. What you are describing is similar to a global install of eslint which isn't recommended, but is supported.

@ljharb ljharb added the question label Nov 6, 2016
@ljharb
Copy link
Collaborator

ljharb commented Nov 6, 2016

Please continue to discuss if needed.

@ljharb ljharb closed this as completed Nov 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants