早午餐在Heroku上构建失败

时间:2014-02-07 04:24:43

标签: node.js heroku bower brunch

在heroku部署期间,我看到NPM正在运行,然后是bower运行 - 所有这些都立即发生,并且似乎有效。然后我开始做早午餐( - 生产) - 所有地狱都松了 - gist

在我过多的调试中,我可能完全有可能在我的配置中没有杀死某些内容,但是,在构建过程中,错误会在我的本地计算机上重现。

我在这里提出了长篇大论的道歉 - 但我是在我的最后一生,需要一些帮助。为什么会失败?是brunch bug still吗?版本问题?我愚蠢而错过了什么?

的package.json

{
  "author": "Name",
  "name": "MyApp",
  "description": "App description",
  "version": "0.0.0",
  "homepage": "",
  "repository": {
    "type": "git",
    "url": ""
  },
  "engines": {
    "node": "~0.11.9"
  },
  "scripts": {
    "install": "./node_modules/bower/bin/bower install",
    "postinstall": "./node_modules/brunch/bin/brunch build",
    "start" : "node app.js"
  },
  "dependencies": {
    "brunch" : "*",
    "javascript-brunch": "*",
    "css-brunch": "*",
    "uglify-js-brunch": "*",
    "clean-css-brunch": "*",
    "auto-reload-brunch": "*",
    "express": "*",
    "twilio" : "*",
    "request" : "*",
    "read-components" : "*",
    "bower" : "*"
   },
  "devDependencies": {
  }
}

config.js

exports.config = {
  files: {
    javascripts: {
      joinTo: 'js/app.js'
    },
    stylesheets: {
      joinTo: 'css/app.css'
    },
    templates: {
      precompile : false,
      defaultExtension : 'hbs',
      root :'templates',
      joinTo: 'js/app.js'
    }
  },
  server: {
    path: 'app.js',
    port: 3333,
    base: '/',
    run: 'yes'
  }
};

bower.json

{
  "name": "test",
  "version": "0.1",
  "dependencies": {
    "jquery" : "~2.0",
    "bootstrap": "~3.0",
    "highcharts" : "latest",
    "firebase" : "latest"
  },
  "overrides": {
    "highcharts": {
      "main": "highcharts-all.js"
    }
  }
}

app.js

var express = require('express'),
    app = express(),
    vote = require('./routes/vote');


app.use(express["static"](__dirname + '/dist'));
app.use(express.urlencoded());

app.get('/', function(req, res) {
return res.sendfile('./dist/index.html');
});

app.post('/vote', vote.addNew);

exports.startServer = function(port, path, callback) {
  var p;
  p = process.env.PORT || port;
  console.log("startServer on port: " + p + ", path " + path);
  return app.listen(p);
};

1 个答案:

答案 0 :(得分:3)

Heroku显然会在vendor目录中抛出不正确的东西。尝试在配置中忽略它:

config = paths: watched: ['app']