-
Notifications
You must be signed in to change notification settings - Fork 744
Cannot read toString of null when using execSync #415
Copy link
Copy link
Closed
Description
I've been occasionally getting the following error:
/private/var/folders/md/b4my_5v94kbcjzbdhs711fnr0000gn/T/shelljs_64464d02b4682598b994:4
fs.writeFileSync('/var/folders/md/b4my_5v94kbcjzbdhs711fnr0000gn/T/shelljs_7bf01b37f53810b840b5', err ? err.code.toString() : '0');
^
TypeError: Cannot read property 'toString' of null
at /private/var/folders/md/b4my_5v94kbcjzbdhs711fnr0000gn/T/shelljs_64464d02b4682598b994:4:115
at ChildProcess.exithandler (child_process.js:220:5)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:827:16)
at Socket.<anonymous> (internal/child_process.js:319:11)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at Pipe._onclose (net.js:475:12)
shell.js: internal error
Error: Command failed: "/usr/local/Cellar/node4-lts/4.4.0/bin/node" /var/folders/md/b4my_5v94kbcjzbdhs711fnr0000gn/T/shelljs_64464d02b4682598b994
at checkExecSyncError (child_process.js:464:13)
at Object.execSync (child_process.js:504:13)
at execSync (/../shelljs/src/exec.js:81:11)
This seems to be caused by the code generated in https://github.com/shelljs/shelljs/blob/master/src/exec.js#L72 - it seems that node now returns an Error object when exec fails, which does not have a 'code' property.
This is with node v4.4.0 on OSX 10.11.3.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels