首页 > 编程语言 >修改Vercel构建时使用的Node版本

修改Vercel构建时使用的Node版本

时间:2023-02-04 01:11:57浏览次数:56  
标签:Node node engines package json 版本 Vercel

Vercel Node 版本的说明

官方参考:意思是设置了 engines.node 后,如果与项目的 node 版本不一致,则使用前者

Defining the node property inside engines of a package.json file will override the selection made in the Project Settings and print a Build Step warning if the version does not match. Please avoid greater than ranges, such as >14.x or >=14, because this will match semver major versions of Node.js once available which contains breaking changes.
For example, the range >16.2.0 would match the versions 16.2.5, 16.3.0, and 18.0.0.

通过 package.json 修改 node 版本

在 package.json 中通过 engines.node 指定 node 版本

{
  ....
  "engines": {
    "node": ">16.14.0 <17"
  },
  ...
}

在界面中修改项目的 Node 版本

注意:若使用 package.json 修改了 Node 版本,且与项目指定的版本不一致,则使用前者

参考:https://vercel.com/docs/concepts/functions/serverless-functions/runtimes/node-js#node.js-version

标签:Node,node,engines,package,json,版本,Vercel
From: https://www.cnblogs.com/engure/p/17090777.html

相关文章

  • Node.js学习第四天-cnblog
    Node.js学习第四天1.基本使用安装[email protected]创建最基本的web服务器constexpress=require('express')constapp=express()app.listen(80,()=>{......
  • 查看Ubuntu版本, 查看CentOS版本
    查看Ubuntu版本,查看CentOS版本。可以统一使用命令cat/etc/os-release查看Ubuntu版本示例PRETTY_NAME="Ubuntu22.04.1LTS"NAME="Ubuntu"VERSION_ID="22.04"VERSI......
  • MeterSphere 版本管理(xpack)使用
    MeterSphere版本管理功能变更记录在MeterSpherev2.6.0版本中接口定义列表支持批量复制指定版本的CASE和Mock数据(X-Pack)在MeterSpherev2.5.0版本中新增了接口置新功能......
  • 项目版本管理方案. 项目版本管理要引起重视
    你->有么有如下经历:项目上线后发现功能缺失,或者不应该出现在该版本.项目紧急回滚手忙脚乱.耗时巨长甚至搞不定.查找历史版本难如登天.经常性出现因代码合并、漏......
  • nodejs下载
    nodejs下载地址:​​https://nodejs.org/dist/​​......
  • Node 版本兼容性问题
    问题描述vue2启动项目时报错如下:>npmrunserveError:error:0308010C:digitalenveloperoutines::unsupportedatnewHash(node:internal/crypto/hash:71:19)......
  • nodemon实现自动重启项目
         ......
  • kubernetes nodeSelector部署节点选择
    1.文档https://kubernetes.io/zh-cn/docs/concepts/scheduling-eviction/assign-pod-node/ 2.说明 nodeSelector 是节点选择约束的最简单推荐形式。你可以将 n......
  • vue版本2.9.6升级到高版本
    由于npminstall-gvue-cli安装的是老版本,如果想要安装新版本,可以先看一下自己是否已经安装了新版本vuecreateproj:可以看到我这边有两个版本了,如果想要安装新版本需要......
  • docker 安装kafka(单机版本)
    网上大多数是这个镜像zookeeper镜像dockerpullwurstmeister/zookeeperkafka镜像dockerpullwurstmeister/kafka  dockerrun-d-p2181:2181--namezookeepe......