odin-fan / enatega-backend-api

This is my own open source solution to enatega custom frontend which is already open source.. I hope to help the open source community even more
4 stars 1 forks source link

How fix this problem? #3

Closed 4eJliK closed 6 days ago

4eJliK commented 6 days ago

I highlighted a line that's white in bash when the others are gray.

$ node app.js node:internal/modules/cjs/loader:1228 throw err; ^

Error: Cannot find module '../../models/restaurant' Require stack:

Node.js v20.18.0

at Object.<anonymous> (C:\Users\Artem\enatega-backend-api\models\user.js:4:2

0)

4eJliK commented 6 days ago

I found the solution, you need to recheck the file you have in error, and in the file was specified '../../models/restaurant', and since they are in 1 directory, you need to replace '../../models/restaurant' with './restaurant'.