3

Well some days ago I was tired to always call sudo when calling npm install and that sort of things so I tried uninstalling node and tried installing via Homebrew, I managed to make a huge disaster but finally it worked. Until now...

When I run node app.js or npm install it just doesn't do anything.

  • I tried deleting the related files like this.

  • I tried using nvm.

  • Tried the manual install with the .pkg file from the node homepage.

  • Tried through homebrew again.

And still no luck; however if the Node app has compilation errors I get the error stack, but when everything is "ok", instead of start listening for incoming connections it just exits with code 0.

Community
  • 1
  • 1
jonathanwiesel
  • 1,036
  • 2
  • 16
  • 35
  • 2
    When you just type `node` to use the REPL, does it work? – Brad Sep 03 '13 at 02:13
  • 2
    Have you tried something simpler, e.g. `console.log('Hello, world!');`? If that works, could you post `app.js`? You might have been using a really old version of Node before, or something. – Ry- Sep 03 '13 at 02:13
  • @Brad yep that works but no `node app.js` nor `npm install` – jonathanwiesel Sep 03 '13 at 02:16
  • 1
    how about `node debug app.js`, does that work? – OneOfOne Sep 03 '13 at 02:18
  • 2
    Do you by chance have a couple versions of Node.js installed? `node -v` says what? – Brad Sep 03 '13 at 02:22
  • @minitech creating a new project with express works well... still in my project the app.js is untouched since the last day it worked. I even did a git stash to make sure of that – jonathanwiesel Sep 03 '13 at 02:33
  • @OneOfOne I get the following output: < debugger listening on port 5858 connecting... ok break in app.js:6 4 */ 5 6 var express = require('express') 7 , http = require('http') 8 , path = require('path') debug> – jonathanwiesel Sep 03 '13 at 02:33
  • 1
    After you get to the debug prompt, hit `c`. – OneOfOne Sep 03 '13 at 02:35
  • @OneOfOne I get: program terminated – jonathanwiesel Sep 03 '13 at 02:37
  • 1
    can you post your app.js? another (painful) thing to try is `node debug app.js` and keep pressing `s` to see where it exits, but that can take a while. – OneOfOne Sep 03 '13 at 02:39

1 Answers1

2

Ok, I feel reaaaaaaaaally stupid after I found the issue, in my postgresql config I had the wrong password for the database and for some reason caused all this mess. Will upvote all of you, will understand if you downvote me for being such a moron.

OneOfOne's node debug then keep pressing s did the trick for me.

jonathanwiesel
  • 1,036
  • 2
  • 16
  • 35
  • You can delete your question, if you think it’s not useful — that’ll definitely avoid downvotes. But it’s not that silly :) – Ry- Sep 03 '13 at 04:49