NodeJS server error while running two servers

I have two NodeJS directories with same files except that the main one is running on PORT 8080 and other on PORT 9000. I am getting the following error while running the second service:

TypeError [ERR_INVALID_ARG_VALUE]: The argument 'mode' must be a 32-bit unsigned integer or an octal string. Received '0o777'

I have defined PORT using

var port = process.env.PORT || 8080; //main one

var port = process.env.PORT || 9000; //second one in a different directory with same files

The error is thrown on this piece of code:

Redis.Promise.onPossiblyUnhandledRejection(function(error) {
    error.command ? logger.error(error, {name:, args: error.command.args}) : logger.error(error);

The same thing is working as expected in another system but my system throws this error at the terminal. I have searched for it but cannot find a possible solution. All I am doing is running node server.js in both directories. What can be the possible reason for this?

Source: AngularJS