You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@netbeans.apache.org by Jessica Ryan <jr...@tech4learning.com> on 2019/03/05 18:02:14 UTC

Debugging Node.js

Hiya folks,

I have a node.js project in Netbeans and would like to debug it.  When I launch via the debug button, I get the following message on the console, and then a few seconds later, I get the following error.

Console:
"/bin/bash" "-lc" "\"/usr/local/bin/node\" \"--debug-brk=9292\" \"/Users/jryan/JDev/SVN/trunk/Node/CollaborationServer/src/server.js\""
Done.
(node:977) [DEP0062] DeprecationWarning: `node --debug` and `node --debug-brk` are invalid. Please use `node --inspect` or `node --inspect-brk` instead.


Then the following message in a dialog:
Cannot run debugger.  Reason:
java.net <http://java.net/>.ConnectException: Connection refused (Connection refused)


It seems like Netbeans needs to update its debug command for current versions of node.js?

Can anyone point me toward how I can update my local copy of Netbeans (I’ve built from from the 10.0 source) to fix this issue, that’d be swell!

-Jess

Re: Debugging Node.js

Posted by Jessica Ryan <jr...@tech4learning.com>.
Bummer.  Thanks for looking in to it, though!



> On Mar 7, 2019, at 1:47 PM, Pete Whelpton <pe...@gmail.com> wrote:
> 
> Unfortunately, it seems that --inspect uses a different protocol (v8-inspector) the --debug (the v8-debugger protocol supported by Netbeans).  Hopefully, some kind person will volunteer to write a v8-inspector debugger module for NB in the future, or add a temporary workaround such as starting node with --inspect and launching Chrome on the DevTools page.
> 
> Sorry to be the bearer of bad news :(
> 
> 
> P
> 
> 
> 
> P
> 
> On Tue, Mar 5, 2019 at 8:46 PM Jessica Ryan <jryan@tech4learning.com <ma...@tech4learning.com>> wrote:
> I tried!  But failed.  Thanks for the quick responses.. I tried modifying the hardcoded values in NodeExecutable.java, rebuilt, and, well, things are different, but still it’s a no go.  I get the following expected output (which is what you get when running node --inspect src/mystuff.js):
> Debugger listening on ws://127.0.0.1:9292/e6fc8a3c-6088-4df0-8a64-dbee7285d9c6 <>
> For help, see: https://nodejs.org/en/docs/inspector <https://nodejs.org/en/docs/inspector>
> 
> But then the executable stops immediately… so, not sure where that’s going.. 
> 
>> On Mar 5, 2019, at 12:26 PM, Geertjan Wielenga <geertjan.wielenga@googlemail.com <ma...@googlemail.com>> wrote:
>> 
>> Be super-awesome, Jess! :-)
>> 
>> Gj
>> 
>> On Tuesday, March 5, 2019, Pete Whelpton <peedeeboy@gmail.com <ma...@gmail.com>> wrote:
>> Hi Jessica,
>> 
>> I believe it is:  webcommon/javascript.nodejs/src/org/netbeans/modules/javascript/nodejs/exec/NodeExecutable.java
>> 
>> There are a couple of constants near the top of the file: DEBUG_BRK_COMMAND & DEBUG_COMMAND
>> 
>> If you want to be super-awesome and submit a pull request, the existing issue in NB's Jira is here: https://issues.apache.org/jira/browse/NETBEANS-1320 <https://issues.apache.org/jira/browse/NETBEANS-1320>
>> 
>> 
>> 
>> P
>> 
>> On Tue, Mar 5, 2019 at 6:18 PM Geertjan Wielenga <ge...@googlemail.com.invalid> wrote:
>> Hi Jess,
>> 
>> And welcome! Yes, someone else reported the same. On GitHub you’ll find the relevant code in the webcommon folder, or someone else will point you to the right spot, or I will in a few hours when I get back to my laptop.
>> 
>> Gj
>> 
>> On Tuesday, March 5, 2019, Jessica Ryan <jryan@tech4learning.com <ma...@tech4learning.com>> wrote:
>> Hiya folks,
>> 
>> I have a node.js project in Netbeans and would like to debug it.  When I launch via the debug button, I get the following message on the console, and then a few seconds later, I get the following error.
>> 
>> Console:
>> "/bin/bash" "-lc" "\"/usr/local/bin/node\" \"--debug-brk=9292\" \"/Users/jryan/JDev/SVN/trunk/Node/CollaborationServer/src/server.js\""
>> Done.
>> (node:977) [DEP0062] DeprecationWarning: `node --debug` and `node --debug-brk` are invalid. Please use `node --inspect` or `node --inspect-brk` instead.
>> 
>> 
>> Then the following message in a dialog:
>> Cannot run debugger.  Reason:
>> java.net <http://java.net/>.ConnectException: Connection refused (Connection refused)
>> 
>> 
>> It seems like Netbeans needs to update its debug command for current versions of node.js?
>> 
>> Can anyone point me toward how I can update my local copy of Netbeans (I’ve built from from the 10.0 source) to fix this issue, that’d be swell!
>> 
>> -Jess
> 


Re: Debugging Node.js

Posted by Pete Whelpton <pe...@gmail.com>.
Unfortunately, it seems that --inspect uses a different protocol
(v8-inspector) the --debug (the v8-debugger protocol supported by
Netbeans).  Hopefully, some kind person will volunteer to write a
v8-inspector debugger module for NB in the future, or add a temporary
workaround such as starting node with --inspect and launching Chrome on the
DevTools page.

Sorry to be the bearer of bad news :(


P



P

On Tue, Mar 5, 2019 at 8:46 PM Jessica Ryan <jr...@tech4learning.com> wrote:

> I tried!  But failed.  Thanks for the quick responses.. I tried modifying
> the hardcoded values in NodeExecutable.java, rebuilt, and, well, things are
> different, but still it’s a no go.  I get the following expected output
> (which is what you get when running node --inspect src/mystuff.js):
> Debugger listening on
> ws://127.0.0.1:9292/e6fc8a3c-6088-4df0-8a64-dbee7285d9c6
> For help, see: https://nodejs.org/en/docs/inspector
>
> But then the executable stops immediately… so, not sure where that’s
> going..
>
> On Mar 5, 2019, at 12:26 PM, Geertjan Wielenga <
> geertjan.wielenga@googlemail.com> wrote:
>
> Be super-awesome, Jess! :-)
>
> Gj
>
> On Tuesday, March 5, 2019, Pete Whelpton <pe...@gmail.com> wrote:
>
>> Hi Jessica,
>>
>> I believe it is:
>> webcommon/javascript.nodejs/src/org/netbeans/modules/javascript/nodejs/exec/NodeExecutable.java
>>
>> There are a couple of constants near the top of the file: DEBUG_BRK_COMMAND
>> & DEBUG_COMMAND
>>
>> If you want to be super-awesome and submit a pull request, the existing
>> issue in NB's Jira is here:
>> https://issues.apache.org/jira/browse/NETBEANS-1320
>>
>>
>>
>> P
>>
>> On Tue, Mar 5, 2019 at 6:18 PM Geertjan Wielenga
>> <ge...@googlemail.com.invalid> wrote:
>>
>>> Hi Jess,
>>>
>>> And welcome! Yes, someone else reported the same. On GitHub you’ll find
>>> the relevant code in the webcommon folder, or someone else will point you
>>> to the right spot, or I will in a few hours when I get back to my laptop.
>>>
>>> Gj
>>>
>>> On Tuesday, March 5, 2019, Jessica Ryan <jr...@tech4learning.com> wrote:
>>>
>>>> Hiya folks,
>>>>
>>>> I have a node.js project in Netbeans and would like to debug it.  When
>>>> I launch via the debug button, I get the following message on the console,
>>>> and then a few seconds later, I get the following error.
>>>>
>>>> Console:
>>>> "/bin/bash" "-lc" "\"/usr/local/bin/node\" \"--debug-brk=9292\"
>>>> \"/Users/jryan/JDev/SVN/trunk/Node/CollaborationServer/src/server.js\""
>>>> Done.
>>>> (node:977) [DEP0062] DeprecationWarning: `node --debug` and `node
>>>> --debug-brk` are invalid. Please use `node --inspect` or `node
>>>> --inspect-brk` instead.
>>>>
>>>>
>>>> Then the following message in a dialog:
>>>> Cannot run debugger.  Reason:
>>>> java.net.ConnectException: Connection refused (Connection refused)
>>>>
>>>>
>>>> It seems like Netbeans needs to update its debug command for current
>>>> versions of node.js?
>>>>
>>>> Can anyone point me toward how I can update my local copy of Netbeans
>>>> (I’ve built from from the 10.0 source) to fix this issue, that’d be swell!
>>>>
>>>> -Jess
>>>>
>>>
>

Re: Debugging Node.js

Posted by Jessica Ryan <jr...@tech4learning.com>.
I tried!  But failed.  Thanks for the quick responses.. I tried modifying the hardcoded values in NodeExecutable.java, rebuilt, and, well, things are different, but still it’s a no go.  I get the following expected output (which is what you get when running node --inspect src/mystuff.js):
Debugger listening on ws://127.0.0.1:9292/e6fc8a3c-6088-4df0-8a64-dbee7285d9c6
For help, see: https://nodejs.org/en/docs/inspector <https://nodejs.org/en/docs/inspector>

But then the executable stops immediately… so, not sure where that’s going.. 

> On Mar 5, 2019, at 12:26 PM, Geertjan Wielenga <ge...@googlemail.com> wrote:
> 
> Be super-awesome, Jess! :-)
> 
> Gj
> 
> On Tuesday, March 5, 2019, Pete Whelpton <peedeeboy@gmail.com <ma...@gmail.com>> wrote:
> Hi Jessica,
> 
> I believe it is:  webcommon/javascript.nodejs/src/org/netbeans/modules/javascript/nodejs/exec/NodeExecutable.java
> 
> There are a couple of constants near the top of the file: DEBUG_BRK_COMMAND & DEBUG_COMMAND
> 
> If you want to be super-awesome and submit a pull request, the existing issue in NB's Jira is here: https://issues.apache.org/jira/browse/NETBEANS-1320 <https://issues.apache.org/jira/browse/NETBEANS-1320>
> 
> 
> 
> P
> 
> On Tue, Mar 5, 2019 at 6:18 PM Geertjan Wielenga <ge...@googlemail.com.invalid> wrote:
> Hi Jess,
> 
> And welcome! Yes, someone else reported the same. On GitHub you’ll find the relevant code in the webcommon folder, or someone else will point you to the right spot, or I will in a few hours when I get back to my laptop.
> 
> Gj
> 
> On Tuesday, March 5, 2019, Jessica Ryan <jryan@tech4learning.com <ma...@tech4learning.com>> wrote:
> Hiya folks,
> 
> I have a node.js project in Netbeans and would like to debug it.  When I launch via the debug button, I get the following message on the console, and then a few seconds later, I get the following error.
> 
> Console:
> "/bin/bash" "-lc" "\"/usr/local/bin/node\" \"--debug-brk=9292\" \"/Users/jryan/JDev/SVN/trunk/Node/CollaborationServer/src/server.js\""
> Done.
> (node:977) [DEP0062] DeprecationWarning: `node --debug` and `node --debug-brk` are invalid. Please use `node --inspect` or `node --inspect-brk` instead.
> 
> 
> Then the following message in a dialog:
> Cannot run debugger.  Reason:
> java.net <http://java.net/>.ConnectException: Connection refused (Connection refused)
> 
> 
> It seems like Netbeans needs to update its debug command for current versions of node.js?
> 
> Can anyone point me toward how I can update my local copy of Netbeans (I’ve built from from the 10.0 source) to fix this issue, that’d be swell!
> 
> -Jess


Re: Debugging Node.js

Posted by Geertjan Wielenga <ge...@googlemail.com.INVALID>.
Be super-awesome, Jess! :-)

Gj

On Tuesday, March 5, 2019, Pete Whelpton <pe...@gmail.com> wrote:

> Hi Jessica,
>
> I believe it is:  webcommon/javascript.nodejs/src/org/netbeans/modules/
> javascript/nodejs/exec/NodeExecutable.java
>
> There are a couple of constants near the top of the file: DEBUG_BRK_COMMAND
> & DEBUG_COMMAND
>
> If you want to be super-awesome and submit a pull request, the existing
> issue in NB's Jira is here: https://issues.apache.org/
> jira/browse/NETBEANS-1320
>
>
>
> P
>
> On Tue, Mar 5, 2019 at 6:18 PM Geertjan Wielenga
> <ge...@googlemail.com.invalid> wrote:
>
>> Hi Jess,
>>
>> And welcome! Yes, someone else reported the same. On GitHub you’ll find
>> the relevant code in the webcommon folder, or someone else will point you
>> to the right spot, or I will in a few hours when I get back to my laptop.
>>
>> Gj
>>
>> On Tuesday, March 5, 2019, Jessica Ryan <jr...@tech4learning.com> wrote:
>>
>>> Hiya folks,
>>>
>>> I have a node.js project in Netbeans and would like to debug it.  When I
>>> launch via the debug button, I get the following message on the console,
>>> and then a few seconds later, I get the following error.
>>>
>>> Console:
>>> "/bin/bash" "-lc" "\"/usr/local/bin/node\" \"--debug-brk=9292\"
>>> \"/Users/jryan/JDev/SVN/trunk/Node/CollaborationServer/src/server.js\""
>>> Done.
>>> (node:977) [DEP0062] DeprecationWarning: `node --debug` and `node
>>> --debug-brk` are invalid. Please use `node --inspect` or `node
>>> --inspect-brk` instead.
>>>
>>>
>>> Then the following message in a dialog:
>>> Cannot run debugger.  Reason:
>>> java.net.ConnectException: Connection refused (Connection refused)
>>>
>>>
>>> It seems like Netbeans needs to update its debug command for current
>>> versions of node.js?
>>>
>>> Can anyone point me toward how I can update my local copy of Netbeans
>>> (I’ve built from from the 10.0 source) to fix this issue, that’d be swell!
>>>
>>> -Jess
>>>
>>

Re: Debugging Node.js

Posted by Pete Whelpton <pe...@gmail.com>.
Hi Jessica,

I believe it is:
webcommon/javascript.nodejs/src/org/netbeans/modules/javascript/nodejs/exec/NodeExecutable.java

There are a couple of constants near the top of the file: DEBUG_BRK_COMMAND
& DEBUG_COMMAND

If you want to be super-awesome and submit a pull request, the existing
issue in NB's Jira is here:
https://issues.apache.org/jira/browse/NETBEANS-1320



P

On Tue, Mar 5, 2019 at 6:18 PM Geertjan Wielenga
<ge...@googlemail.com.invalid> wrote:

> Hi Jess,
>
> And welcome! Yes, someone else reported the same. On GitHub you’ll find
> the relevant code in the webcommon folder, or someone else will point you
> to the right spot, or I will in a few hours when I get back to my laptop.
>
> Gj
>
> On Tuesday, March 5, 2019, Jessica Ryan <jr...@tech4learning.com> wrote:
>
>> Hiya folks,
>>
>> I have a node.js project in Netbeans and would like to debug it.  When I
>> launch via the debug button, I get the following message on the console,
>> and then a few seconds later, I get the following error.
>>
>> Console:
>> "/bin/bash" "-lc" "\"/usr/local/bin/node\" \"--debug-brk=9292\"
>> \"/Users/jryan/JDev/SVN/trunk/Node/CollaborationServer/src/server.js\""
>> Done.
>> (node:977) [DEP0062] DeprecationWarning: `node --debug` and `node
>> --debug-brk` are invalid. Please use `node --inspect` or `node
>> --inspect-brk` instead.
>>
>>
>> Then the following message in a dialog:
>> Cannot run debugger.  Reason:
>> java.net.ConnectException: Connection refused (Connection refused)
>>
>>
>> It seems like Netbeans needs to update its debug command for current
>> versions of node.js?
>>
>> Can anyone point me toward how I can update my local copy of Netbeans
>> (I’ve built from from the 10.0 source) to fix this issue, that’d be swell!
>>
>> -Jess
>>
>

Re: Debugging Node.js

Posted by Geertjan Wielenga <ge...@googlemail.com.INVALID>.
Hi Jess,

And welcome! Yes, someone else reported the same. On GitHub you’ll find the
relevant code in the webcommon folder, or someone else will point you to
the right spot, or I will in a few hours when I get back to my laptop.

Gj

On Tuesday, March 5, 2019, Jessica Ryan <jr...@tech4learning.com> wrote:

> Hiya folks,
>
> I have a node.js project in Netbeans and would like to debug it.  When I
> launch via the debug button, I get the following message on the console,
> and then a few seconds later, I get the following error.
>
> Console:
> "/bin/bash" "-lc" "\"/usr/local/bin/node\" \"--debug-brk=9292\"
> \"/Users/jryan/JDev/SVN/trunk/Node/CollaborationServer/src/server.js\""
> Done.
> (node:977) [DEP0062] DeprecationWarning: `node --debug` and `node
> --debug-brk` are invalid. Please use `node --inspect` or `node
> --inspect-brk` instead.
>
>
> Then the following message in a dialog:
> Cannot run debugger.  Reason:
> java.net.ConnectException: Connection refused (Connection refused)
>
>
> It seems like Netbeans needs to update its debug command for current
> versions of node.js?
>
> Can anyone point me toward how I can update my local copy of Netbeans
> (I’ve built from from the 10.0 source) to fix this issue, that’d be swell!
>
> -Jess
>