Mac WebStorm error: cannot find module 'eslint-config-airbnb'

I participate in the ReactNative project and prefer to use airbnb. I have npm install airbnb global:

  • npm install -g airbnb (as well as dependencies)
  • .eslintrc file with extends configuration: eslint-config-airbnb
  • WebStorm activated ESLint and used the above .eslintrc

There was an error below:

Error: cannot find module 'eslint-config-airbnb'

Additional Information:

  • MacOS
  • WebStorm 2017.1.2
+5
source share
1 answer

The plugin and eslint should be installed in the same place, i.e. if eslint s global, then the plugin must be global, and if it is local, then both must be local.

With this Webstorm, the local version of eslint is used, not the global one (this at least works with windows). So make sure you install eslint and the plugin locally using npm install .

Hope this helps.

+6
source

All Articles