3

In following a tutorial, I ran the following command to install eslint airbnb and a few dependencies

$ sudo npm install -g eslint-config-airbnb eslint-plugin-import eslint-plugin-react eslint-plugin-jsx-a11y

Upon completion I received a number of warnings

npm WARN eslint-plugin-react@7.6.0 requires a peer of eslint@^3.0.0 || ^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-plugin-import@2.8.0 requires a peer of eslint@2.x - 4.x but none is installed. You must install peer dependencies yourself.
npm WARN eslint-configeslint-config-airbnb-airbnb@16.1.0 requires a peer of eslint@^4.9.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-airbnb-base@12.1.0 requires a peer of eslint@^4.9.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-plugin-jsx-a11y@6.0.3 requires a peer of eslint@^3 || ^4 but none is installed. You must install peer dependencies yourself.

Ok, so.... I'm beginning to think the tutorial is outdated and something has changed. What (if anything) am I missing?

Please advise.

sleeper
  • 3,446
  • 7
  • 33
  • 50

2 Answers2

5

Each node package has dependencies it works perfectly or has been tested with hence the warning you get since they are the ones that are recommended or declared in the packages configs . Hence the warnings. It is recommended to follow the required packages to avoid errors, but most of the time unless you get an error then you should be good to go as the the alluded to package itself at whatever version exists.

In your case confirm you have eslint in you package.json, if not run:

npm install eslint --save-dev
iamcaleberic
  • 913
  • 8
  • 12
  • I have eslint installed, so it sounds like your saying im good to go (unless I get errors while running)? – sleeper Jan 27 '18 at 20:34
0

All the warning are about peer dependencies. They are categorised as WARN instead of ERROR, because if your application code never touch such a dependency, you will be good. Fully tested code can ensure that these warnings can be safely ignored.

Excellent explanation to peer dependency

themefield
  • 3,847
  • 30
  • 32