Thursday, 1 June 2017

I cannot resolve a directory in my folder for some bizarre reason

Everytime I try to run my app.js file, I get an error that says

Cannot find module './models/recipe'

However, in my folder directory, I clearly have the models folder with my recipe.js file under it. And in my recipe.js file I have const Recipe = require('./models/recipe'); as one of the first lines of the file.

None of these makes any sense. I am doing everything correctly as far as I know. Can anyone help me?

Here is my directory structure of my folder

drwxr-xr-x 1 gabar 197609   0 Jun  1 13:15 ./
drwxr-xr-x 1 gabar 197609   0 May 30 18:33 ../
drwxr-xr-x 1 gabar 197609   0 Jun  1 13:39 .idea/
-rw-r--r-- 1 gabar 197609 725 Jun  1 13:14 app.js
drwxr-xr-x 1 gabar 197609   0 Jun  1 13:16 models/
drwxr-xr-x 1 gabar 197609   0 May 31 18:46 node_modules/
-rw-r--r-- 1 gabar 197609 783 May 31 18:46 package.json
drwxr-xr-x 1 gabar 197609   0 May 31 17:03 public/
drwxr-xr-x 1 gabar 197609   0 Jun  1 13:22 routes/
drwxr-xr-x 1 gabar 197609   0 May 31 14:07 views/



via T-Dot1992

No comments:

Post a Comment