我的MEAN堆栈应用程序在本地完美运行,但是当我将它推送到我正在托管它的Heroku时,我得到“应用程序错误”。这是我在终端中执行heroku日志时得到的输出。
State changed from crashed to starting
Starting process with command `node app.js`
module.js:471
throw err;
^
Error: Cannot find module '../object/keys'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/app/node_modules/aws-sdk/node_modules/xmlbuilder/node_modules/lodash/internal/baseAssign.js:2:12)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/app/node_modules/aws-sdk/node_modules/xmlbuilder/node_modules/lodash/object/assign.js:1:80)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
答案 0 :(得分:0)
通常,您希望在应用程序开发的早期阶段设置Heroku,以防止出现任何疯狂错误。您的依赖项可能会触发此操作。我会尝试使用Digital Ocean作为Heroku的替代品。