Gatsby, fix the "cannot find module gatsby-cli/lib/reporter" error
How I fixed a weird Error: Cannot find module gatsby-cli/lib/reporter error I got while creating a Gatsby site
I created a site using Gatsby and I ran gatsby develop
to start a local server.
But a weird error showed up, coloring with red my terminal:
After a few searches across 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
instead of npm install
:
yarn
This installed all the packages again.
Finally I ran gatsby develop
and it worked.
Not sure what the cause problem is/was, but I tried again running npm install
instead of yarn
and it didn’t work.
I wrote 17 books to help you become a better developer, download them all at $0 cost by joining my newsletter
- C Handbook
- Command Line Handbook
- CSS Handbook
- Express Handbook
- Git Cheat Sheet
- Go Handbook
- HTML Handbook
- JS Handbook
- Laravel Handbook
- Next.js Handbook
- Node.js Handbook
- PHP Handbook
- Python Handbook
- React Handbook
- SQL Handbook
- Svelte Handbook
- Swift Handbook
JOIN MY CODING BOOTCAMP, an amazing cohort course that will be a huge step up in your coding career - covering React, Next.js - next edition February 2025