G
G
gooke2018-03-28 10:56:35
Node.js
gooke, 2018-03-28 10:56:35

Why might a JS error occur when running through node?

The text of the error

[email protected]:/var/www/html/bot# node app.js
/var/www/html/bot/shop.js:55
    console.tag('Магазин').log(log);
            ^

TypeError: Cannot read property 'tag' of undefined
    at siteShopLogger (/var/www/html/bot/shop.js:55:13)
    at generatekey (/var/www/html/bot/shop.js:60:2)
    at Object.<anonymous> (/var/www/html/bot/shop.js:22:22)
    at Module._compile (module.js:649:30)
    at Object.Module._extensions..js (module.js:660:10)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:501:12)
    at Function.Module._load (module.js:493:3)
    at Module.require (module.js:593:17)
    at require (internal/module.js:11:18)

Day 2 I'm scratching my head

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Alekseev, 2018-03-28
@gooket

Because tag is not a standard console method and to use it you need to override the standard console on process.console
check https://github.com/bluejamesbond/Scribe.js/wiki/4-...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question