mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-16 02:44:51 +00:00
12 lines
470 B
TypeScript
12 lines
470 B
TypeScript
import { engines } from '../../package.json'
|
|
|
|
export async function checkEngines () {
|
|
const semver = await import('semver').then(r => r.default || r)
|
|
const currentNode = process.versions.node
|
|
const nodeRange = engines.node
|
|
|
|
if (!semver.satisfies(process.versions.node, engines.node)) {
|
|
console.warn(`Current version of Node.js (\`${currentNode}\`) is unsupported and might cause issues.\n Please upgrade to a compatible version (${nodeRange}).`)
|
|
}
|
|
}
|