benawad / graphql-express-template

Node.js GraphQL Server template
525 stars 195 forks source link

[Question] Cannot find module ./models #11

Closed luckyvs1 closed 6 years ago

luckyvs1 commented 6 years ago

Just around the 26:32 mark of your tutorial and I ran into the following error

module.js:471
    throw err;
    ^

Error: Cannot find module './models'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)

I have the models folder with the user.js and index.js file and outside in my project directory the index.js file has the following import models from './models';

Do you have any suggestions on what I should be looking at to resolve this issue?

Thanks

luckyvs1 commented 6 years ago

There was a space in the folder name which I didn't catch, so this isn't an issue.