In my initial react application (created by react-native init project_name
). In my project folder, I install my ESLint locally by yarn add eslint --dev
This is caused by a bug in NPM 5 where npm install
will delete almost all of your dependencies. This was the relevant issue. Even though you are using yarn
, eslint
will use npm
under the hood to install the dependencies it needs, and thus will run into the aforementioned bug.
This has very recently been fixed in npm >= 5.7.1, so you will need to upgrade npm
and then reinstall all of your modules.
Personally, I'd just recreate the entire project from scratch since it doesn't seem like you've done anything yet. It would be a lot more straightforward than trying to fix things.
By upgrading, you will also be able to use react-native-cli
without error as prior to v5.7.1, you were actually supposed to use NPM 4. See this bug.