MCPcopy Index your code
hub / github.com/triggerdotdev/trigger.dev / runtimeCheck

Function runtimeCheck

packages/cli-v3/src/utilities/runtimeCheck.ts:6–28  ·  view source on GitHub ↗
(minimumMajor: number, minimumMinor: number)

Source from the content-addressed store, hash-verified

4 * This function is used by the dev CLI to make sure that the runtime is compatible
5 */
6export function runtimeCheck(minimumMajor: number, minimumMinor: number) {
7 // Check if the runtime is Node.js
8 if (typeof process === "undefined") {
9 throw "The dev CLI can only be run in a Node.js compatible environment";
10 }
11
12 // Check if the runtime version is compatible
13 const [major = 0, minor = 0] = process.versions.node.split(".").map(Number);
14
15 const isBun = typeof process.versions.bun === "string";
16
17 if (major < minimumMajor || (major === minimumMajor && minor < minimumMinor)) {
18 if (isBun) {
19 throw `The dev CLI requires at least Node.js ${minimumMajor}.${minimumMinor}. You are running Bun ${process.versions.bun}, which is compatible with Node.js ${process.versions.node}`;
20 } else {
21 throw `The dev CLI requires at least Node.js ${minimumMajor}.${minimumMinor}. You are running Node.js ${process.versions.node}`;
22 }
23 }
24
25 logger.debug(
26 `Node.js version: ${process.versions.node}${isBun ? ` (Bun ${process.versions.bun})` : ""}`
27 );
28}

Callers 1

devCommandFunction · 0.90

Calls 1

debugMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…