chore: restrict node version (#3120)

(cherry picked from commit 05291a8a36)
This commit is contained in:
Alex Yang
2023-07-10 14:19:59 +08:00
parent 28316861e3
commit d42c53c3da
6 changed files with 43 additions and 1 deletions
+13
View File
@@ -0,0 +1,13 @@
import semver from 'semver';
import packageJson from '../package.json' assert { type: 'json' };
const { engines } = packageJson;
const version = engines.node;
if (!semver.satisfies(process.version, version)) {
console.log(
`Required node version ${version} not satisfied with current version ${process.version}.`
);
process.exit(1);
}