I have the following code in a file called server.js.
var http = require(\'http\');
http.createServer(function (request, response) {
response.writeHead(200,
This is old, but I ran into this same problem. Exact same message (with my machine name of course). The issue was that there was another node executable on the path, in C:\Program Files (x86)\CA\SharedComponents\PEC\bin
. I'm on a windows machine, so running where node
showed the two conflicting "node" executables in the path.
To fix the problem, I just removed the CA directory from the PATH
environment variable.