Running node.js code just displays a node identifier

node.js

Solution

Was getting this when I was trying to run cordova commands. Steps to resolve:

Windows

- In CMD prompt, type "where node". As Michael mentioned, this shows you the likely culprit, that you have 2 nodejs EXEs installed on your machine.

- Navigate to Start > Computer > Right-click Properties > Advanced system settings

- Under the Advanced tab, select Environment Variables

- Under System variables, select "Path" variable

- Find nodejs EXE, usually "C:\Program Files (x86)\nodejs\"

- Cut and paste this to the beginning of the "Path" variable. Ensure the paths are separated by a ";"

- Open a new CMD prompt and try cordova again

Problem

I have the following code in a file called server.js. ``` var http = require('http'); http.createServer(function (request, response) { response.writeHead(200, {'Content-Type': 'text/plain'}); response.end('Hello World\n'); }).listen(8124); console.log('Server running at http://127.0.0.1:8124/'); ``` I use the command prompt and naviage to the folder where the file recides and then the run the command ``` node server.js ``` But I don't get the expected output. Instead I get ``` The node identifier for {My Machine Name} is v2hrfnqaj. ``` Note: I already have node installed in my machine and it was working fine.

Original source