fix: detect corepack node version need to equal minimize (#703)

This commit is contained in:
mashiro 2024-04-04 16:59:40 +08:00 committed by GitHub
parent 0fdc401f91
commit 5bb7bdb9f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -20,7 +20,7 @@ function compareVersions(v1, v2) {
const currentVersion = process.version.substring(1);
const targetVersion = "18.17.1";
if (compareVersions(currentVersion, targetVersion) > 0) {
if (compareVersions(currentVersion, targetVersion) >= 0) {
console.log(`Current Node.js version is ${currentVersion}, corepack is supported.`);
} else {
console.error(`Current Node.js version is ${currentVersion}, but corepack is unsupported. Required version: ^${targetVersion}.`);