AFFiNE/scripts/check-version.mjs

16 lines
440 B
JavaScript
Raw Normal View History

const semver = await import('semver').catch(() =>
import('../packages/backend/server/node_modules/semver/index.js')
);
2023-07-10 09:19:59 +03:00
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);
}