title: Node.JS cannot find json file, everything is right
body: <p>When I'm using my test application, I get this error:</p>
  <pre class="lang-js prettyprint-override"><code>C:\Users\****\Downloads\noded.js website tetstst&gt;node app.js
  internal/modules/cjs/loader.js:985
    throw err;
    ^
  
  Error: Cannot find module 'd.json'
  Require stack:
  - C:\Users\*****\Downloads\noded.js website tetstst\app.js
      at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
      at Function.Module._load (internal/modules/cjs/loader.js:864:27)
      at Module.require (internal/modules/cjs/loader.js:1044:19)
      at require (internal/modules/cjs/helpers.js:77:18)
      at Object.&lt;anonymous&gt; (C:\Users\****\Downloads\noded.js website tetstst\app.js:4:17)
      at Module._compile (internal/modules/cjs/loader.js:1158:30)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
      at Module.load (internal/modules/cjs/loader.js:1002:32)
      at Function.Module._load (internal/modules/cjs/loader.js:901:14)
      at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [ 'C:\\Users\\*****\\Downloads\\noded.js website tetstst\\app.js' ]
  }
  </code></pre>
  <p>My code is:</p>
  <pre class="lang-js prettyprint-override"><code>const express = require('express')
  const app = express()
  const fs = require('fs')
  const details = require('d.json')
  const bcrypt = require('bcrypt')
  app.set('view engine', 'ejs')
  
  const bodyParser = require('body-parser');
  app.use(bodyParser.urlencoded({ extended: true }));
  
  app.get('/', function (req, res) {
    res.render('index')
  })
  
  app.post('/', function (req, res) {
      res.render('index');
      const email = req.body.email
      const username = req.body.username
      if(!details[username]) {
          details[username] = {
              &quot;email&quot;: email,
              &quot;password&quot;: &quot;plain&quot;
          }
          const password = bcrypt.genSalt(saltRounds, function(err, salt) {
              bcrypt.hash(req.body.password, salt, function(err, hash) {
                  details[username].password = hash
              });
          });
      }else{
          if(details[username]){
              return res.render('index', {weather: 'Pass!' + username, error: null});
          }else{
              return res.render('index', {weather: 'No User Found For:' + username, error: null});
          }
      }
      
  })
  
  app.listen(3000, function () {
    console.log('Example app listening on port 3000!')
  })
  </code></pre>
  <p>This is my directory image:</p>
  <p><a href="https://i.stack.imgur.com/EtqAT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EtqAT.png" alt="Directory" /></a></p>
  <p>Hopefully someone could answer and save me and other people's time.</p>
  <p>My OS:</p>
  <p>Windows 64 Bit Windows Home 10
  Node.JS Version 12.8.1 LTS
  Visual Studio Code (not sure if that matters)</p>