'NODE JS - Can you tell me what I am doing wrong with the directory order?

I am super new to Node JS and I was able to run this js file before. Right now, I can't and I don't know why. It says that it doesn't see app.js file under the config folder but as you see there is app.js under the config and I also gave direction in server.js. Please help me out.

enter image description here



Solution 1:[1]

if you are importing app.js file its a good idea to add .js at the end just like this

var app = require('../server/config/app.js')

Solution 2:[2]

You are using .. when your server.js file is at the same level as the server directory. Use one . and it should work

const app = require('./server/config/app');

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Manu Jo Varghese
Solution 2 Pytth