npmnpm-installnpm-update

How to fix Npm missing peer dependency


I do not know how to fix below peer dependency error.

mondwan@mondwan-All-Series:~/Documents/git/py-cli_build_tools$ sudo npm -g list | grep eslint    
├─┬ babel-eslint@7.1.1
├─┬ eslint@3.12.2
├─┬ eslint-config-airbnb@13.0.0
│ └── eslint-config-airbnb-base@10.0.1
├─┬ eslint-config-eslint@3.0.0
├─┬ eslint-plugin-import@2.2.0
│ ├─┬ eslint-import-resolver-node@0.2.3
│ ├─┬ eslint-module-utils@2.0.0
├─┬ UNMET PEER DEPENDENCY eslint-plugin-jsx-a11y@3.0.2
├─┬ eslint-plugin-react@6.8.0
npm ERR! peer dep missing: eslint-plugin-jsx-a11y@^2.2.3, required by eslint-config-airbnb@13.0.0

As you see, I have installed eslint-plugin-jsx-a11y@3.0.2 which is definitely fulfill ^2.2.3 required by

eslint-config-airbnb. However, it shows such error message. Any idea for solving such problem?


Solution

  • I have mis-understood the meaning of the ^ in version ^2.2.3.

    After reading this link, ^2.2.3 means >=2.2.3 <3.X. That's why npm throws an warning.

    Besides, below are links about peer-dependencies