【发布时间】:2015-06-29 02:22:42
【问题描述】:
当我尝试推送到 heroku master 时遇到一系列错误。
remote: npm ERR! Tell the author that this fails on your system:
remote: npm ERR! bower install
https://devcenter.heroku.com/articles/nodejs-support 的文档向我展示了如何添加凉亭
这是我的 package.json。我不确定我可能会错过什么。我已经确定了我的引擎和 npm。
{
"name": "caffeine",
"version": "0.0.0",
"private": true,
"scripts": {
"postinstall": "bower install",
"start": "node app.js"
},
"dependencies": {
"body-parser": "~1.12.0",
"cookie-parser": "~1.3.4",
"debug": "~2.1.1",
"express": "~4.12.2",
"express-session": "^1.11.3",
"jade": "~1.9.2",
"moment": "^2.10.3",
"mongoose": "^4.0.2",
"morgan": "~1.5.1",
"node-phantom-simple": "^1.2.0",
"passport": "^0.2.2",
"passport-facebook": "^2.0.0",
"passport-google-oauth": "^0.2.0",
"passport-local": "^1.0.0",
"passport-local-mongoose": "^1.0.0",
"serve-favicon": "^2.2.0",
"should": "^6.0.3",
"swig": "^1.4.2"
},
"devDependencies": {
"gulp": "^3.9.0",
"gulp-jshint": "^1.11.0",
"gulp-nodemon": "^2.0.3"
},
"engines": {
"node": "0.10.29",
"npm": "2.1.11"
}
}
【问题讨论】:
-
这似乎是您的 heroku + bower 设置的问题。您能否验证在
heroku上是否按预期安装了凉亭。此外,您的链接似乎指向通用帮助页面。 Here 是一个您可能会发现有用的页面。还有更详细的错误日志吗?这两行并不能告诉我们很多。 -
昨晚我在 package.json 中设置了 bower。哪个凉亭为我提供了我需要的用户路径。我得到了更多的错误。当我添加 heroku open 时,我得到: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico。这可能是很多事情,所以我试图重构所有内容,因为我不知道这是什么是。
-
可以通过在 express 中添加路由以捕获任何不匹配的路径并返回 404 错误来解决网站图标问题。
-
您得到“应用程序崩溃”很可能是因为“bower install”失败并且您缺少“bower_components”目录及其所有好东西。当然也可能有其他原因。
标签: heroku npm bower-install