How to Debug Node.js Code

Published: 29 July 2014
on channel: Techy Help
1,137
like

Can you tell me how to debug Node.js code?

Install the node package modules or NPM off legitimate websites instead of someone’s computer science graduate project.

I got the one off GitHub.

Use good API libraries to install the cloud server nodes. And make sure you install all the files you need.

That’s all good for installation, but I have a good installation. I need to know how to debug the code I’m creating for Node.js.

You could use a tool like Node Inspector. That’s designed to be a debugger interface for Node.js applications.

I’ve never heard of it.

I can understand why, since it hasn’t been kept up to work with the latest versions of Node.js. Well, they come up with new versions but Strong Loop doesn’t always keep up with the latest Node.js version.

So what options do I have?

So run the Node.js applications through WebStorm, which is supported by the Node.js plugin. Though it won’t work if you don’t enable the plugin.

Or, like a lot of things, if you don’t put it in the debug configuration.

A starting place might be alert debugging via print statements.

That requires putting it in the code I’m writing.

It is like putting pause statements in code to help you identify which sections contain errors. Then again, you could use Locus to troubleshoot via command line injection.

I’m not that good at command line stuff; if I was, I’d be in PHP.

So use node monkey.

I’m not a code monkey. I’m a developer.

Node Monkey is a debugger for Node.js.

Any other ideas?

Joyent has its own debugging guide for Node.js, though I’m not really familiar with it. Or use the Node Webkit Agent.

I like having options, so I can find something that works.

Then, hopefully, so will your code.


Watch video How to Debug Node.js Code online without registration, duration hours minute second in high quality. This video was added by user Techy Help 29 July 2014, don't forget to share it with your friends and acquaintances, it has been viewed on our site 1,137 once and liked it like people.