Skip to content

Commit 2b13863

Browse files
authored
Fix Node version check (#12382)
`process.version` always starts with `v`, so `parseInt(process.version)` always evaluates to `NaN`. See https://nodejs.org/api/process.html#process_process_version
1 parent b36f988 commit 2b13863

File tree

1 file changed

+1
-1
lines changed
  • packages/babel-cli/src/babel

1 file changed

+1
-1
lines changed

packages/babel-cli/src/babel/util.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ process.on("uncaughtException", function (err) {
117117
export function requireChokidar(): Object {
118118
try {
119119
// todo(babel 8): revert `@nicolo-ribaudo/chokidar-2` hack
120-
return parseInt(process.version) >= 8
120+
return parseInt(process.versions.node) >= 8
121121
? require("chokidar")
122122
: require("@nicolo-ribaudo/chokidar-2");
123123
} catch (err) {

0 commit comments

Comments
 (0)