1

I'm using the MEANstack for a project and hit up this error when trying to load the model from seed.js:

module.js:340
throw err;
^
Error: Cannot find module '..api/callout/callout.model'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (C:\onemore\server\config\seed.js:12:15)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)

Proof of existence of the file:

Directory of C:\onemore\server\api\callout

01/27/2015  03:47 PM    <DIR>          .
01/27/2015  03:47 PM    <DIR>          ..
01/27/2015  03:27 PM             2,267 callout.controller.js
01/27/2015  03:47 PM               308 callout.model.js
01/27/2015  03:39 PM               602 index.js

Since I have other models that I set up the exact same way and they are working, I can't explain what is going on.

Ioana Grozav
  • 135
  • 1
  • 7

2 Answers2

1

That's probably ../api/....... rather than ..api/........

Also, make sure that the relative path is correct.

Madara's Ghost
  • 172,118
  • 50
  • 264
  • 308
0

Replace that path with ../api/callout/callout.model

surajck
  • 1,186
  • 9
  • 23