为什么我在创建新的 Gatsby 项目后收到“Minified React error #31”?

Lor*_*lia 3 reactjs gatsby

我尝试在我的计算机上安装gatsby-cli并创建了一个新项目,但在生成它并尝试为其提供服务后,我得到了Minified React error #31. 这些是我遵循的步骤:

npm i -g gatsby-cli
Run Code Online (Sandbox Code Playgroud)

并且有许多我无法恢复的漏洞问题。我认为这与hapi. 然后:

$ gatsby new my-project
$ cd my-project
$ gatsby serve
Run Code Online (Sandbox Code Playgroud)

然后我得到

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.
Run Code Online (Sandbox Code Playgroud)

这是一个已知的常见错误吗?

这是我的环境信息:

macOS 10.14 Mojave
node v12.22
npm v7.21
Run Code Online (Sandbox Code Playgroud)

C-D*_*Dev 12

gatsby develop运行开发服务器。如果您想运行生产构建,则需要gatsby build构建应用程序,然后gatsby serve运行生产构建。