javascript - Gatsby 3.X + Netlify

标签 javascript node.js gatsby netlify

我最近将我的 Gatsby 项目从 2.X 升级到 3.X,但我在使用 Netlify 时遇到了一些部署问题。此问题从何而来?如何在 Netlify 中更新 Node.js?

Netlify 控制台:

5:24:48 PM: error Gatsby requires Node.js 12.13.0 or higher (you have v10.24.0).
5:24:48 PM: Upgrade Node to the latest stable release: https://gatsby.dev/upgrading-node-js

enter image description here

ma​​cOS 终端:

enter image description here

最佳答案

在将现有 Netlify 站点从 Gatsby 2 更新到 3 时,我遇到了同样的问题。Netlify Forum建议简单地向该 Netlify 站点添加一个环境变量:

NODE_VERSION=12

我不喜欢这个解决方案,因为部署 Gatsby 3 项目在部署到新创建的 Netlify 站点时没有任何问题,但它确实让我再次前进。

关于javascript - Gatsby 3.X + Netlify,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66880068/

相关文章:

javascript - Date.now() 是自纪元以来的本地毫秒数,还是自纪元以来的毫秒数(UTC 时间)

javascript - 如何在 Sails.js 中保护蓝图访问

wordpress - Gatsby-Source-Wordpress : Error when compiling. 类型错误:无法解构 'fields' 的属性 'nodesType',因为它未定义

javascript - Typescript 根据 if 语句自动判断类型是什么

javascript - Cypress 无法使用 ENOTFOUND 加载网站

javascript - 错误 : Cannot find module '../lib/cli'

javascript - 无法使用 Mongoose 从对象数组中删除元素

c# - 动态改变CSS

reactjs - 使用 Gatsby 或 SPA 的 SEO 结构化数据

wordpress - 如何使用引导网格映射图像数组?