eslint: Can't install eslint

I followed the install instructions: npm install -g eslint and then this:

$ eslint --init
? How would you like to configure ESLint? Use a popular style guide
? Which style guide do you want to follow? Standard
? What format do you want your config file to be in? JavaScript
Installing eslint-plugin-standard, eslint-config-standard
@mperham/sidekiq@0.5.0 /Users/mike/src/sjs
├── UNMET PEER DEPENDENCY eslint@^2.0.0-rc.0
├── eslint-config-standard@5.1.0 
├── UNMET PEER DEPENDENCY eslint-plugin-promise@^1.0.8
├── eslint-plugin-standard@1.3.2 
└── sidekiq@1.1.1  extraneous

npm WARN eslint-config-standard@5.1.0 requires a peer of eslint@^2.0.0-rc.0 but none was installed.
npm WARN eslint-config-standard@5.1.0 requires a peer of eslint-plugin-promise@^1.0.8 but none was installed.
npm WARN @mperham/sidekiq@0.5.0 No repository field.

Running eslint lib gives this:

$ eslint lib

Oops! Something went wrong! :(

ESLint couldn't find the plugin "eslint-plugin-standard". This can happen for a couple different reasons:
[snip]

I’m new to the JavaScript world - please let me know if you need more info.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 20 (17 by maintainers)

Commits related to this issue

Most upvoted comments

@zxqfox that already exists: https://www.npmjs.com/package/eslint-cli. We don’t really want to disable global installs due to some editors using it.

I think maybe, “ESLint was installed locally. We recommend using this local copy instead of your globally-installed copy.”?

With the changes in my branch, the installation would remain unchanged if ESLint is installed locally, but will look like the following when it isn’t: Pre-installation: screen shot 2016-04-15 at 12 04 50 am Post-installation: screen shot 2016-04-15 at 12 05 03 am

Ergh, sometimes I wish we could disable global installs of eslint altogether, for all the confusion it causes.

I tend to think it would be a bad thing to install plugins globally during --init, as even more than ESLint itself they will vary from project to project. But, I’m not sure the right way to approach this. Maybe we can try to detect if --init was run from a global installation, and if so disable the Use a popular style guide option? Or warn immediately and disable --init altogether? I’m definitely open to ideas and discussion on this one.