diff --git a/src/index.ts b/src/index.ts index 5d9b9b12..d707cde0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -11,7 +11,7 @@ function checkCWD() { } } function checkNodeVersion() { - const root = pkgDir.sync(__dirname) || '..' + const root = pkgDir.sync(__dirname) || path.join(__dirname, '..') const pjson = require(path.join(root, 'package.json')) if (!semver.satisfies(process.versions.node, pjson.engines.node)) { process.stderr.write(`WARNING\nWARNING Node version must be ${pjson.engines.node} to use this CLI\nWARNING Current node version: ${process.versions.node}\nWARNING\n`)