【发布时间】:2020-11-08 16:20:42
【问题描述】:
我的 gatsby 项目运行良好,也有 404 页面,但是我在 gatsby build 期间收到错误,或者在成功完成构建过程后打开浏览器:
Building static HTML for pageserror: Error: ENOENT: no such file or directory
如果我在gatsby build 时间内没有收到错误,那么我必须在运行gatsby serve 并打开浏览器时进入浏览器:
Error: ENOENT: no such file or directory, stat '/project/public/404.html'
【问题讨论】:
-
尝试添加404页面
-
@BloodyLogic 当你运行
gatsby clean,然后运行gatsby build,gatsby serve时发生了什么? -
@ShinaBR2 已经尝试过
rm -rf node_module .cache public但没有帮助我,不过它在前一段时间就可以工作了!
标签: node.js reactjs typescript gatsby