Skip to content

Commit

Permalink
Fix Node version check (babel#12382)
Browse files Browse the repository at this point in the history
`process.version` always starts with `v`, so `parseInt(process.version)` always evaluates to `NaN`. See https://nodejs.org/api/process.html#process_process_version
  • Loading branch information
Hypnosphi authored and nicolo-ribaudo committed Dec 2, 2020
1 parent b9580a5 commit 5f4b78c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/babel-cli/src/babel/util.js
Expand Up @@ -117,7 +117,7 @@ process.on("uncaughtException", function (err) {
export function requireChokidar(): Object {
try {
// todo(babel 8): revert `@nicolo-ribaudo/chokidar-2` hack
return parseInt(process.version) >= 8
return parseInt(process.versions.node) >= 8
? require("chokidar")
: require("@nicolo-ribaudo/chokidar-2");
} catch (err) {
Expand Down

0 comments on commit 5f4b78c

Please sign in to comment.