title: Unable to run node server.js
body: <pre><code>const http = require('http');
  
  // Create an instance of the http server to handle HTTP requests
  let app = http.createServer((req, res) =&gt; {
      // Set a response type of plain text for the response
      res.writeHead(200, {'Content-Type': 'text/plain'});
  
      // Send back a response and end the connection
      res.end('Hello World!\n');
  });
  
  // Start the server on port 3000
  app.listen(3000, '127.0.0.1');
  console.log('Node server running on port 3000');
  </code></pre>
  
  <p>I am using the above code to create a simple server.</p>
  
  <p>But when i am running it, I am getting error.</p>
  
  <blockquote>
    <p>Nileshs-MacBook-Pro:azureSocketServer njha$ node server.js
    internal/modules/cjs/loader.js:796
        throw err;
        ^</p>
    
    <p>Error: Cannot find module '/Users/njha/Documents/AzureSample/azureSocketServer/server.js'
        at Function.Module._resolveFilename (internal/modules/cjs/loader.js:793:17)
        at Function.Module._load (internal/modules/cjs/loader.js:686:27)
        at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10)
        at internal/main/run_main_module.js:17:11 {
      code: 'MODULE_NOT_FOUND',
      requireStack: []
    }</p>
  </blockquote>
  
  <p>My folder structure.
  <a href="https://i.stack.imgur.com/pm7IA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pm7IA.png" alt="enter image description here"></a></p>