Node is fun! Except when it’s not. It’s pretty easy stuff, but I was burned by a couple things today while debugging. Take note!
- You can – and MUST, at times – mess with installed node modules; hack away directly at their source for instantaneous satisfaction!
- find them here:
- linux (always easier): ~/.npm
- Windows: C:\Users\#name#\AppData\Roaming\npm
- however, watch out that you follow dependencies properly; if a module requires another, it will often keep a copy underneath its folder; there may also be a global copy in the root npm folder
- find them here:
- debugging is most easily accomplished by the good old-fashioned “jam in print statements” hacker methodology
- via console.log(“WHAT IS HAPPENING!?);
- when you grow up and want to get into serious debugging, use linux, and sling your code into the Chrome debugger, via node-inspector