MCPcopy
hub / github.com/vitejs/vite / checkNodeVersion

Function checkNodeVersion

packages/vite/src/node/cli.ts:15–22  ·  view source on GitHub ↗
(nodeVersion: string)

Source from the content-addressed store, hash-verified

13import type { InlineConfig } from './config'
14
15function checkNodeVersion(nodeVersion: string): boolean {
16 const currentVersion = nodeVersion.split('.')
17 const major = parseInt(currentVersion[0], 10)
18 const minor = parseInt(currentVersion[1], 10)
19 const isSupported =
20 (major === 20 && minor >= 19) || (major === 22 && minor >= 12) || major > 22
21 return isSupported
22}
23
24if (!checkNodeVersion(process.versions.node)) {
25 // eslint-disable-next-line no-console

Callers 1

cli.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected