GearmaNode icon indicating copy to clipboard operation
GearmaNode copied to clipboard

TypeError: Cannot set property 'isLevelEnabled' of undefined

Open DavidRadan opened this issue 6 years ago • 10 comments

Hi There, It seems that this repository doesn't work anymore because of the "winston" plugin which has been changed , It could be great if you could fix these issues , at least update this plugin so that the plugin will be useful again.

Tested with latest node 10.6.0 .

Thanks in advanced .


var gearmanode2 = require('gearmanode');
//gearmanode.Client.logger.transports.console.level = 'info';

var client = gearmanode2.client({servers:[{host: '192.168.0.70', port: 4730}]});

var job = client.submitJob('reverse', 'hello world!');
job.on('workData', function(data) {
    console.log('WORK_DATA >>> ' + data);
});

job.on('complete', function() {
    console.log('RESULT >>> ' + job.response);
    client.close();
});



[winston] Attempt to write logs with no transports %j logger.js:202 Object {level: "info", message: "GearmaNode %s, running on Node.js %s [%s %s], with…", Symbol(level): "info", Symbol(splat): Array(5)} logger.js:202 TypeError: Cannot set property 'isLevelEnabled' of undefined gearmanode.js:41 at Object. (c:(!) Projects2018\GearmanNode\node_modules\gearmanode\lib\gearmanode.js:41:41) at Module._compile (internal/modules/cjs/loader.js:689:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:20:18) at Object. (c:(!) Projects2018\GearmanNode\Client.js:1:81) at Module._compile (internal/modules/cjs/loader.js:686:14)

DavidRadan avatar Jul 08 '18 19:07 DavidRadan

@DavidRadan

If you want to fix this issue you can add to your project's dependencies:

  "dependencies": {
    "winston": "^0.7.1",
  }

Or do a npm install --save [email protected], since it is the last version Gearmanode had compatibility with winston. That should solve your problem as it solved mine.

aledefreitas avatar Jul 23 '18 22:07 aledefreitas

Hi aledefreitas ,

Many thanks for the solution but we decided to build our own solution based on node.js .

Regards,

DavidRadan avatar Jul 24 '18 10:07 DavidRadan

I have lost couple hours with this, I think a < 3.0 will be great on the dependencies

rkmax avatar Jul 31 '18 10:07 rkmax

I think it would be wise to use other open source "queue" solution as this solution seems to be outdated . Building new solutions based on this technology can cause a huge headache in the future . Regards, David

DavidRadan avatar Jul 31 '18 10:07 DavidRadan

@DavidRadan Actually, we have used this project for three years, it is so stable that we even no need to maintain. And it is not only a kind of "queue" solution, it enables you to do every thing distributed because of Gearman's protocol.

mike442144 avatar Aug 14 '18 09:08 mike442144

@DavidRadan

If you want to fix this issue you can add to your project's dependencies:

  "dependencies": {
    "winston": "^0.7.1",
  }

Or do a npm install --save [email protected], since it is the last version Gearmanode had compatibility with winston. That should solve your problem as it solved mine.

super, thanks

kvelaro avatar Feb 08 '19 14:02 kvelaro

@DavidRadan thank you for solution to :

nooby w evaluation of gearmanode and winston that failed outta box on strange winston fails to init or construct class instance. "0.7.1" solved it for me

rowntreerob avatar Oct 29 '20 18:10 rowntreerob

Sorry your solution is not working with winston anymore with newer nodejs. Is there any development?

kvelaro avatar Sep 06 '22 16:09 kvelaro

"winston": "^0.7.1", Thanks!!

Succes in Node.js v18.12.1

tiehumobilenow avatar Mar 04 '23 11:03 tiehumobilenow

[email protected] is too old..... My node server code wants to use new API on winston, but if installing that way, gearmanode gonna get error.. There is [email protected] https://github.com/winstonjs/winston

SeaJungg avatar Apr 18 '23 04:04 SeaJungg