Why am I getting "Minified React error #31" after creating a new Gatsby project?

Viewed 4129

I've tried installing gatsby-cli on my machine and created a new project, but after I generate it and try to serve it, I get Minified React error #31. These are the steps I've followed:

npm i -g gatsby-cli

And got many vulnerability issues I can't recover. I think it had to do with hapi. Then:

$ gatsby new my-project
$ cd my-project
$ gatsby serve

Then I get

failed We've encountered an error: Minified React error #31; visit
https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=Error%3A%20ENOENT%3A%20no%20such%20file%20or%20directory%2C%20open%20'%
2FUsers%2Fwayoshi%2FDev%2Flegionhack-home%2F.cache%2Fmatch-paths.json'&args[]= for the full message or use the non-minified dev
environment for full errors and additional helpful warnings.

Would this be a known common error?

Here's my enviroment info:

macOS 10.14 Mojave
node v12.22
npm v7.21
1 Answers

gatsby develop runs the development server. If you want to run a production build you need gatsby build to build the app and then gatsby serve to run the production build.

Related