Unknown error in node.js scripting

I have created a post file upload event using node.js

I find that the script is sometime working but most of the time it is returning Code 500

{ "error": { "context": null, "message": "Executed command returned with error code: 1", "code": 500, "trace": [

I am not sure whats wrong with the code but this error occurs even when i remove all code and leave it blank.