节点JS Heroku无法获取/

时间:2016-02-27 15:05:52

标签: javascript node.js heroku

我的Procfile

web: node web.js

我的package.json

{
  "name": "tattoohipfront",
  "private": true,
  "devDependencies": {
    "autoprefixer-core": "^5.2.1",
    "grunt": "^0.4.5",
    "grunt-angular-templates": "^0.5.7",
    "grunt-concurrent": "^1.0.0",
    "grunt-contrib-clean": "^0.6.0",
    "grunt-contrib-compass": "^1.0.0",
    "grunt-contrib-concat": "^0.5.0",
    "grunt-contrib-connect": "^0.9.0",
    "grunt-contrib-copy": "^0.7.0",
    "grunt-contrib-cssmin": "^0.12.0",
    "grunt-contrib-htmlmin": "^0.4.0",
    "grunt-contrib-imagemin": "^1.0.0",
    "grunt-contrib-jshint": "^0.11.0",
    "grunt-contrib-uglify": "^0.7.0",
    "grunt-contrib-watch": "^0.6.1",
    "grunt-filerev": "^2.1.2",
    "grunt-google-cdn": "^0.4.3",
    "grunt-jscs": "^1.8.0",
    "grunt-newer": "^1.1.0",
    "grunt-ng-annotate": "^0.9.2",
    "grunt-postcss": "^0.5.5",
    "grunt-svgmin": "^2.0.0",
    "grunt-usemin": "^3.0.0",
    "grunt-wiredep": "^2.0.0",
    "jit-grunt": "^0.9.1",
    "time-grunt": "^1.0.0",
    "jshint-stylish": "^1.0.0"
  },
  "engines": {
    "node": ">=0.10.0"
  },
  "dependencies": {
    "express": "^4.13.4",
    "gzippo": "^0.2.0"

  },
  "scripts": {
    "start": "node web.js"
  }
}

和我的web.js

var gzippo = require('gzippo');
  var express = require('express');
  var app = express();

  app.use(gzippo.staticGzip("" + __dirname + "/dist"));
  app.listen(process.env.PORT || 5000);

我的所有文件都在根目录中,当我运行grunt服务时没有错误,错误仍然只是heroku ...

我正在使用Windows 7和使用PowerShell

在heroku机器上进行部署

1 个答案:

答案 0 :(得分:1)

export class JobsearchPage { selectedClassification:string; constructor(http: Http, nav: NavController, messagesService:MessagesService, navParams:NavParams) { this.http = http; this.messagesService = messagesService; this.nav = nav; this.classifications = new Array("t9it", 'uitut'); console.log('STP selected'+selectedClassification); } } 说什么?

根据所有grunt依赖关系,我打赌你想要从heroku logs --tail(或dependencies)将咕噜声移到devDependencies。你还需要在postinstall中运行你的grunt构建:

heroku config:set NPM_CONFIG_PRODUCTION=false

Heroku有一个关于此的教程:

https://devcenter.heroku.com/articles/node-with-grunt