2016-02-28 65 views
0

在手机上加载我的测试MEAN应用程序时,mongo上出现以下错误。Mongo在手机上加载时出错

我不知道哪个模块是那个,因为我自己没有加载它。

奇怪的是,在桌面浏览器上,错误不会弹出。

我使用猫鼬作为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

你可以分享一下代码:'/home/rafapaulin/lab/rpg-am/routes/general.js:13:10'。它可能有帮助。 – unflores

+0

肯定@unflores '变种modelNamer =函数(集合){ 返回要求( '../架构/' + collection.slice(0,-1)+ '模式') };' 基本上,这函数根据传递的路由构建模型的名称。 它在桌面上工作,实际上,它也适用于移动设备上的POST请求......错误只是在页面加载到移动设备上时弹出,但路由仍然有效 –

回答

0

好的,所以我认为这里可能会有一些魔术与你的路径发生。您可以尝试从桌面和移动设备上调用此命令时记录当前路径。

或者你可以尝试类似下面的内容:absolute requires这将确保你需要一些绝对路径从你的server.js目录。