question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'eslint --init' installs wrong versions of depencies for AirBnB

See original GitHub issue

Tell us about your environment Windows 10

  • ESLint Version: 3.7.1
  • Node Version: 5.3.0
  • npm Version: 3.3.12

What parser (default, Babel-ESLint, etc.) are you using? N/A Please show your full configuration: AirBnB style guide What did you do? Please include the actual source code causing the issue.

npm init
Use a popular style guide
Airbnb
JSON

What did you expect to happen? I expected the node modules to install correctly. What actually happened? Please include the actual, raw output from ESLint. Eslint failed to correctly install dependencies as seen at the bottom of this output:

C:\SWDev\job-frontend>eslint --init                                                                                                                                                          
? How would you like to configure ESLint? Use a popular style guide                                                                                                                          
? Which style guide do you want to follow? Airbnb                                                                                                                                            
? What format do you want your config file to be in? JSON                                                                                                                                    
Installing eslint-plugin-react, eslint-plugin-jsx-a11y, eslint-plugin-import, eslint-config-airbnb                                                                                           
npm WARN install Couldn't install optional dependency: Unsupported                                                                                                                           
job-frontend@0.0.0 C:\SWDev\job-frontend                                                                                                                                                     
β”œβ”€β”¬ eslint@3.7.1                                                                                                                                                                             
β”‚ └── doctrine@1.3.0                                                                                                                                                                         
β”œβ”€β”¬ eslint-config-airbnb@12.0.0                                                                                                                                                              
β”‚ β”œβ”€β”€ eslint-config-airbnb-base@8.0.0                                                                                                                                                        
β”‚ └── UNMET PEER DEPENDENCY eslint-plugin-import@^1.16.0                                                                                                                                     
β”œβ”€β”¬ UNMET PEER DEPENDENCY eslint-plugin-import@2.0.0                                                                                                                                         
β”‚ β”œβ”€β”€ contains-path@0.1.0                                                                                                                                                                    
β”‚ β”œβ”€β”€ eslint-import-resolver-node@0.2.3   
β”‚ β”œβ”€β”¬ eslint-module-utils@1.0.0                                                                                                                                                              
β”‚ β”‚ └── pkg-dir@1.0.0                                                                                                                                                                        
β”‚ β”œβ”€β”€ lodash.cond@4.5.2                                                                                                                                                                      
β”‚ └── pkg-up@1.0.0                                                                                                                                                                           
β”œβ”€β”¬ eslint-plugin-jsx-a11y@2.2.3                                                                                                                                                             
β”‚ └── damerau-levenshtein@1.0.3                                                                                                                                                              
└── eslint-plugin-react@6.4.1                                                                                                                                                                

npm WARN EPEERINVALID eslint-config-airbnb@12.0.0 requires a peer of eslint-plugin-import@^1.16.0 but none was installed.                                                                    
npm WARN EPEERINVALID eslint-config-airbnb-base@8.0.0 requires a peer of eslint-plugin-import@^1.16.0 but none was installed.                                                                
npm WARN EPACKAGEJSON job-frontend@0.0.0 No license field.

Workaround The AirBnB style guide for standard javascript is actually eslint-config-airbnb-base, the one used by the wizard is for react. So I swapped out that package and chose the versions of the decencies that would work (with either react or standard AirBnB).

Initialized package.json:

    "eslint-config-airbnb": "^12.0.0",
    "eslint-plugin-import": "^2.0.0",
    "eslint-plugin-jsx-a11y": "^2.2.3",

Updated package.json:

    "eslint-config-airbnb-base": "^8.0.0",
    "eslint-plugin-import": "^1.16.0",
    "eslint-plugin-jsx-a11y": "^2.2.2",

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:16 (12 by maintainers)

github_iconTop GitHub Comments

25reactions
michaelmcmillancommented, Nov 18, 2016

This is so broken it’s not even funny.

7reactions
tirithencommented, Dec 14, 2016

This has been broken for soo long now, are there any other close match standards that just works? Eslint seemed nice but it’s split out in so many packages that this really is becoming a pain to setup.

Read more comments on GitHub >

github_iconTop Results From Across the Web

It might not work since ESLint's version is mismatched with ...
Looking at the repo, eslint-config-standard@17.x.y by default works with eslint 8.8.0 (even though it's still a pre-release).
Read more >
eslint-config-airbnb
Install the correct versions of each package, which are listed by the command: npm info "eslint-config-airbnb@latest" peerDependencies.
Read more >
Cannot find module 'eslint-config-airbnb-base' #10388
I'm working on a node.js express project , I have installed Eslint globaly npm ... I'v got this error : cannot find module...
Read more >
eslint-config-airbnb-base
Otherwise, run npm info "eslint-config-airbnb-base@latest" peerDependencies to list the peer dependencies and versions, then run yarn add --dev <dependency>@<Β ...
Read more >
eslint/eslint - Gitter
Error : ESLint couldn't find the config "eslint-config-airbnb-base" to extend from ... You must install peer dependencies yourself. npm WARNΒ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found