Question: I have an app built in node.js and I use the node inspector in order to debug.
But it's quite hard because of this:

1. My breakpoints are never saved after I restart the server
2. I cannot put a breakpoint on a file that has not loaded yet; so I have to step into from the first script to the one I want; REALLY PAINFULL!

How do you really debug node.js with node inspector? 

The videos on how to use node.js are quite misleading as everything is into a module...  

<http://www.youtube.com/watch?v=AOnK3NVnxL8> 

or this one the scripts appear are already loaded in the first script  

<http://www.youtube.com/watch?v=HJOH0-g8f6E&feature=mfu_in_order&list=UL> 

Edit:
-----

Nobody can answer this question? :s

Answer: 
In javascript you can set breakpoints using the `debugger;` statement. However, they will only pause node if a debugger is actually attached.

So launch your node script using

```
node --debug-brk myfile.js

```

then launch node-inspector and press the play button to continue to the next breakpoint and it will hit your `debugger;` breakpoint (at least that works for me ATM)

*(as noted in the comments: in recent versions of node you no longer have to separately install node-inspector. If you launch node using `node --debug-brk --inspect myfile.js` you get a url that launches the debugger in your browser).*

you still need one extra click after restarting, but at least your breakpoints are saved.

if your breakpoint is not hit automatically, but only after some user action you don't need the `--debug-brk` of course.
Try using IntelliJ WebStorm - there's a free trial and licenses aren't outrageously expensive. It lets you save breakpoints in all your files prior to starting up its own internal node process and remembers them across process restarts.

I agree - node-inspector looks brilliant, but is quite useless unless your app has a clear place to set a breakpoint in the top level script just after your source files have loaded, but before you hit the area you want to debug. You can structure your own code this way, but you won't be so lucky with other helpful libraries you want to include. Also... why should a debugging tool dictate your project structure!

Forgetting breakpoints is extremely unhelpful... most of my debug runs take more than one walkthrough, as in other people's code it's easy to step past where you want to be.