在我的手机上加载测试MEAN应用时,我在mongo上收到以下错误。
我不知道那是哪个模块,因为我自己没有加载它。
奇怪的是,在桌面浏览器上,不会弹出错误。
我使用mongoose作为mongodb驱动程序。可能错误与它有关。
任何见解?
Error: Cannot find module '../schemas/favicon.icSchema'
at Function.Module._resolveFilename (module.js:339:15)
at Function.Module._load (module.js:290:25)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at modelNamer (/home/rafapaulin/lab/rpg-am/routes/general.js:13:10)
at /home/rafapaulin/lab/rpg-am/routes/general.js:19:3
at Layer.handle [as handle_request] (/home/rafapaulin/lab/rpg-am/node_modules/express/lib/router/layer.js:95:5)
at next (/home/rafapaulin/lab/rpg-am/node_modules/express/lib/router/route.js:131:13)
at Route.dispatch (/home/rafapaulin/lab/rpg-am/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/home/rafapaulin/lab/rpg-am/node_modules/express/lib/router/layer.js:95:5)
at /home/rafapaulin/lab/rpg-am/node_modules/express/lib/router/index.js:277:22
at param (/home/rafapaulin/lab/rpg-am/node_modules/express/lib/router/index.js:349:14)
at param (/home/rafapaulin/lab/rpg-am/node_modules/express/lib/router/index.js:365:14)
at Function.process_params (/home/rafapaulin/lab/rpg-am/node_modules/express/lib/router/index.js:410:3)
at next (/home/rafapaulin/lab/rpg-am/node_modules/express/lib/router/index.js:271:10)
at Function.handle (/home/rafapaulin/lab/rpg-am/node_modules/express/lib/router/index.js:176:3)
答案 0 :(得分:0)
好的,所以我认为你的道路可能会发生一些神奇的事情。您可以尝试记录从桌面和移动设备调用时的当前路径。
或者您可以尝试以下内容:absolute requires这将确保您需要具有来自server.js目录的绝对路径的内容。