# Fix Gatsby 'cannot find module gatsby-cli/lib/reporter'

> Learn how to fix the Gatsby Cannot find module gatsby-cli/lib/reporter error by deleting node_modules and reinstalling with yarn instead of npm install.

Author: [Flavio Copes](https://flaviocopes.com/about/) | Published: 2020-08-15 | Topics: [JavaScript](https://flaviocopes.com/tags/js/) | Canonical: https://flaviocopes.com/gatsby-fix-lib-reporter-error/

I created a site using [Gatsby](https://flaviocopes.com/gatsby/) and I ran `gatsby develop` to start a local server.

But a weird error showed up, coloring with red my terminal:

![Gatsby error](https://flaviocopes.com/images/gatsby-fix-lib-reporter-error/Screen_Shot_2020-08-14_at_14.33.19.jpg)

After a few searches across [GitHub](https://flaviocopes.com/github/) and StackOverflow (I found a lot of people with the same problem!) and this is what fixed the error.

First, I deleted `node_modules`:

```
rm -rf node_modules
```

then I used [`yarn`](https://flaviocopes.com/yarn/) instead of `npm install`:

```
yarn
```

This installed all the packages again.

Finally I ran `gatsby develop` and it worked.

![Terminal showing successful Gatsby development server startup with build process completing and localhost URLs displayed](https://flaviocopes.com/images/gatsby-fix-lib-reporter-error/Screen_Shot_2020-08-14_at_14.35.34.jpg)

Not sure what the cause problem is/was, but I tried again running `npm install` instead of `yarn` and it didn't work.
