解决 Vercel Node.js 版本报错问题“Error: Node.js Version "12.x" ... upgraded.... Project Settings to use Node.js 16”

错误日志

Error: Node.js Version “12.x” is discontinued and must be upgraded. Please set Node.js Version to 16.x in your Project Settings to use Node.js 16.

小山翻译:

错误:已经停止对 Node.js 12.x 的支持,必须升级到更高版本。请在项目设置中将 Node.js 升级到 16.x 以便使用。

[22:15:41.807] Cloning gitlab.com/yijile/hexo (Branch: master, Commit: f242483)
[22:15:43.258] Cloning completed: 1.450s
[22:15:43.726] Looking up build cache...
[22:15:45.164] Build cache downloaded [13.80 MB]: 1077.043ms
[22:15:45.205] Running "vercel build"
[22:15:45.743] Vercel CLI 28.4.4
[22:15:46.126] Error: Node.js Version "12.x" is discontinued and must be upgraded. Please set Node.js Version to 16.x in your Project Settings to use Node.js 16.
[22:15:46.126] Learn More: http://vercel.link/node-version

解决方法:修改 Vercel 中 Node.js 的版本

修改 Vercel 中 Node.js 的版本

  1. 打开你的项目
  2. 选择项目设置(Settings)
  3. 选择通用设置(General)
  4. 找到 Node.js 版本设置(Node.js Version)
  5. 点击版本,选择 16.x
  6. 点击保持(Save)

重新部署(Redeploy)

我已经部署,但是上次部署已经失败,所以需要手动重新部署一下。在部署中选择最新的记录,然后选择重新部署(Redeploy),等一两分钟就会看到成功部署的信息。山高水长,Vercel 的免费服务真心不错。上下几分钟就能搭建一个网站,希望 Vercel 可以越来越好。部署方式真的很方便,而且不用考虑安全问题(近期发现很多 PHP 自建站都被黑了)。

  1. 打开你的项目
  2. 选择部署(Deployments)
  3. 找到失败的记录,选择更多菜单(三个点的图标)
  4. 选择重新构建(Redeploy)
  5. 弹窗对话框,直接点击右下角重新构建(Redeploy)

Relay Tips: 一极乐https://yijile.com/log/505/