Heroku当我在线部署我的应用程序时崩溃但是在我的本地机器上它运行没有错误

时间:2015-11-04 15:27:57

标签: node.js mongodb heroku mongoose meanjs

Nov 04 09:50:57 eva-app-nodejs heroku/web.1:  Starting process with command `npm start` 
Nov 04 09:50:59 eva-app-nodejs app/web.1:  > Eva@0.0.1 start /app 
Nov 04 09:50:59 eva-app-nodejs app/web.1:  > nodemon ./bin/www 
Nov 04 09:50:59 eva-app-nodejs app/web.1:  [nodemon] 1.8.1 
Nov 04 09:50:59 eva-app-nodejs app/web.1:  [nodemon] to restart at any time, enter `rs` 
Nov 04 09:50:59 eva-app-nodejs app/web.1:  [nodemon] watching: *.* 
Nov 04 09:50:59 eva-app-nodejs app/web.1:  [nodemon] starting `node ./bin/www` 
Nov 04 07:18:57 eva-app-nodejs app/web.1:  module.js:339 
Nov 04 07:18:57 eva-app-nodejs app/web.1:      throw err; 
Nov 04 07:18:57 eva-app-nodejs app/web.1:      ^ 
Nov 04 07:18:57 eva-app-nodejs app/web.1:  Error: Cannot find module 'mongodb/node_modules/mongodb-core/node_modules/bson/lib/bson/objectid' 
Nov 04 07:18:57 eva-app-nodejs app/web.1:      at Function.Module._resolveFilename (module.js:337:15) 
Nov 04 07:18:57 eva-app-nodejs app/web.1:      at Function.Module._load (module.js:287:25) 
Nov 04 07:18:57 eva-app-nodejs app/web.1:      at Module.require (module.js:366:17) 
Nov 04 07:18:57 eva-app-nodejs app/web.1:      at require (module.js:385:17) 
Nov 04 07:18:57 eva-app-nodejs app/web.1:      at Object.<anonymous> (/app/node_modules/mongoose/lib/drivers/node-mongodb-native/objectid.js:9:16) 
Nov 04 07:18:57 eva-app-nodejs app/web.1:      at Module._compile (module.js:425:26) 
Nov 04 07:18:57 eva-app-nodejs app/web.1:      at Object.Module._extensions..js (module.js:432:10) 
Nov 04 07:18:57 eva-app-nodejs app/web.1:      at Module.load (module.js:356:32) 
Nov 04 07:18:57 eva-app-nodejs app/web.1:      at Function.Module._load (module.js:311:12) 
Nov 04 07:18:57 eva-app-nodejs app/web.1:      at Module.require (module.js:366:17) 
Nov 04 07:18:57 eva-app-nodejs app/web.1:      at require (module.js:385:17) 

当我尝试将代码发送到heroku时,它会在日志中显示此错误。 我可以毫无问题地运行它,即使我重新安装所有的依赖项。 mongoose版本是4.0.0

1 个答案:

答案 0 :(得分:1)

之前我遇到过这个问题。您是否尝试将节点版本添加到heroku?

Specify Node.js Version