diff --git a/dist/setup/index.js b/dist/setup/index.js index 117dc50d..84095537 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -71774,11 +71774,10 @@ function parseNodeVersionFile(contents) { nodeVersion = (_a = found === null || found === void 0 ? void 0 : found.groups) === null || _a === void 0 ? void 0 : _a.version; if (!nodeVersion) { try { - // Try parsing the file as an NPM `package.json` - // file. - nodeVersion = (_b = JSON.parse(contents).engines) === null || _b === void 0 ? void 0 : _b.node; + // Try parsing the file as an NPM `package.json` file. + nodeVersion = (_b = JSON.parse(contents).volta) === null || _b === void 0 ? void 0 : _b.node; if (!nodeVersion) - (_c = JSON.parse(contents).volta) === null || _c === void 0 ? void 0 : _c.node; + nodeVersion = (_c = JSON.parse(contents).engines) === null || _c === void 0 ? void 0 : _c.node; if (!nodeVersion) throw new Error(); } diff --git a/src/installer.ts b/src/installer.ts index e4dde61e..6414bfa9 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -504,7 +504,7 @@ export function parseNodeVersionFile(contents: string): string { try { // Try parsing the file as an NPM `package.json` file. nodeVersion = JSON.parse(contents).volta?.node; - if (!nodeVersion)nodeVersion = JSON.parse(contents).engines?.node; + if (!nodeVersion) nodeVersion = JSON.parse(contents).engines?.node; if (!nodeVersion) throw new Error(); } catch (err) { // In the case of an unknown format,