MCPcopy Create free account
hub / github.com/vercel/vercel / getLatestNodeVersion

Function getLatestNodeVersion

packages/build-utils/src/fs/node-version.ts:104–120  ·  view source on GitHub ↗
(availableVersions?: NodeVersionMajor[])

Source from the content-addressed store, hash-verified

102}
103
104export function getLatestNodeVersion(availableVersions?: NodeVersionMajor[]) {
105 const all = getOptions();
106 if (availableVersions) {
107 // Return the first node version that is definitely
108 // available in the build-container.
109 for (const version of all) {
110 for (const major of availableVersions) {
111 if (version.major === major) {
112 return version;
113 }
114 }
115 }
116 }
117 // As a fallback for local `vc build` and the tests,
118 // return the first node version if none is found.
119 return all[0];
120}
121
122export function getDiscontinuedNodeVersions(): NodeVersion[] {
123 return getOptions().filter(version => {

Callers 4

unit.test.tsFile · 0.90
getNodeVersionFunction · 0.90
getHintFunction · 0.85
getSupportedNodeVersionFunction · 0.85

Calls 1

getOptionsFunction · 0.85

Tested by

no test coverage detected