【发布时间】:2014-03-22 11:11:42
【问题描述】:
我使用 yeoman angular-fullstack 生成器构建了我的应用程序,然后为我自己的目的进行了修改。我使用 yo angular-fullstack:deploy heroku 构建了 dist 文件夹以部署到 heroku。它为我创建了一个新的 heroku 应用程序,当我 cd 进入 dist 文件夹并 git push heroku master 时,一切正常。
我希望能够将我现有的 heroku 应用程序添加到这个 dist 文件夹的部署过程中,所以我关注了这个帖子 How to link a folder with an existing Heroku app。然后,我可以使用与 heroku 不同的远程名称部署到我自己的应用程序。
当它开始在 heroku 上运行时,我一直收到同样的错误。我不明白为什么完全相同的代码在为我创建的应用程序上运行良好,但在我现有的应用程序上运行良好。这几乎就像我需要清除 node_modules 并再次推送?
2014-02-21T04:43:51.989439+00:00 app[web.1]: module.js:340
2014-02-21T04:43:51.996351+00:00 app[web.1]: Error: Cannot find module './errors/cast'
2014-02-21T04:43:51.996351+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:338:15)
2014-02-21T04:43:51.991555+00:00 app[web.1]: throw err;
2014-02-21T04:43:51.991785+00:00 app[web.1]: ^
2014-02-21T04:43:51.996351+00:00 app[web.1]: at require (module.js:380:17)
2014-02-21T04:43:51.996351+00:00 app[web.1]: at Module.require (module.js:36 4:17)
2014-02-21T04:43:51.996351+00:00 app[web.1]: at Function.Module._load (module.js:280:25)
2014-02-21T04:43:51.996351+00:00 app[web.1]: at Module._compile (module.js:456:26)
2014-02-21T04:43:51.996351+00:00 app[web.1]: at Function.Module._load (module.js:312:12)
2014-02-21T04:43:51.996351+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/mongoose/lib/error.js:32:27)
2014-02-21T04:43:51.996351+00:00 app[web.1]: at Module.load (module.js:356:32)
2014-02-21T04:43:51.996351+00:00 app[web.1]: at Object.Module._extensions..js (module.js:474:10)
2014-02-21T04:43:51.996560+00:00 app[web.1]: at Module.require (module.js:364:17)
2014-02-21T04:43:53.457214+00:00 heroku[web.1]: State changed from starting to crashed
这是 dist 文件夹中的 packages.json
{
"name": "myapp",
"version": "1.0.0",
"dependencies": {
"express": "~3.4.3",
"lodash": "~2.4.1",
"mongoose": "~3.5.5",
"mongoose-unique-validator": "~0.3.0",
"connect-mongo": "~0.4.0",
"passport": "latest",
"passport-local": "latest",
"passport-facebook": "latest",
"passport-twitter": "latest",
"passport-google": "latest",
"ejs": "~0.8.4"
},
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"test": "grunt test"
}
}
【问题讨论】:
标签: node.js git angularjs heroku yeoman