【发布时间】:2015-10-23 13:36:01
【问题描述】:
我正在尝试将我的 Node.js Express 应用程序升级到更新的 Mongodb 驱动程序。我的 package.json 有“mongodb”:“^2.0.40”。它在我的机器上运行良好,我可以很好地部署到 Heroku(如,没有警告/错误)。但是,应用程序在使用时崩溃,并出现以下错误:
2015-09-14T13:03:52.225525+00:00 heroku[web.1]: Starting process with command `node app.js`
2015-09-14T13:03:52.271972+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2015-09-14T13:03:54.315461+00:00 heroku[web.1]: Process exited with status 143
2015-09-14T13:03:54.701499+00:00 app[web.1]: module.js:338
2015-09-14T13:03:54.701522+00:00 app[web.1]: throw err;
2015-09-14T13:03:54.701523+00:00 app[web.1]: ^
2015-09-14T13:03:54.701525+00:00 app[web.1]: Error: Cannot find module 'mongodb-core'
2015-09-14T13:03:54.701526+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:336:15)
2015-09-14T13:03:54.701527+00:00 app[web.1]: at Function.Module._load (module.js:278:25)
2015-09-14T13:03:54.701529+00:00 app[web.1]: at require (module.js:384:17)
2015-09-14T13:03:54.701528+00:00 app[web.1]: at Module.require (module.js:365:17)
2015-09-14T13:03:54.701531+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/mongodb/index.js:2:12)
2015-09-14T13:03:54.701532+00:00 app[web.1]: at Module._compile (module.js:460:26)
2015-09-14T13:03:54.701533+00:00 app[web.1]: at Object.Module._extensions..js (module.js:478:10)
2015-09-14T13:03:54.701534+00:00 app[web.1]: at Module.load (module.js:355:32)
2015-09-14T13:03:54.701535+00:00 app[web.1]: at Function.Module._load (module.js:310:12)
2015-09-14T13:03:54.701536+00:00 app[web.1]: at Module.require (module.js:365:17)
2015-09-14T13:03:55.561071+00:00 heroku[web.1]: State changed from starting to crashed
2015-09-14T13:03:55.548974+00:00 heroku[web.1]: Process exited with status 1
我尝试了各种版本的mongodb驱动,都无济于事。
【问题讨论】:
-
您介意填充 package.json “依赖项”部分吗?和“远程:----->构建成功!”从输出?..