Skip to content

Commit

Permalink
Fixed TypeError for nodejs > 8
Browse files Browse the repository at this point in the history
Some errors are thrown when trying to use this package with Node v10.15.0
throw new ERR_INVALID_ARG_TYPE('options.cwd', 'string', options.cwd)
TypeError [ERR_INVALID_ARG_TYPE]: The "options.cwd" property must be of type string
  • Loading branch information
ajay-gupta committed Jul 9, 2020
1 parent 8fd83e2 commit fa7d8c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ cmds.forEach(function (cmd) {
cmd = "exec "+cmd;
}
var child = spawn(sh,[shFlag,cmd], {
cwd: checkNodeVersion('8.0.0', process.versions.node) ? process.cwd() : process.cwd,
cwd: parseInt(process.versions.node) < 8 ? process.cwd : process.cwd(),
env: process.env,
stdio: ['pipe', process.stdout, process.stderr]
})
Expand Down

0 comments on commit fa7d8c4

Please sign in to comment.