Heroku无法读取属性'原型'未定义的

时间:2017-04-17 14:02:53

标签: ruby-on-rails node.js heroku

我目前正在尝试将应用程序放在heroku上,并且我一直有这个错误,有什么想法吗?

我添加了Procfile以使heroku运行我的app因为我没有使用npm start。在我的机器上它只会发出警告,但我不知道造成这种情况的原因。

TypeError: Cannot read property 'prototype' of undefined
    2017-04-17T13:55:16.903231+00:00 app[web.1]:     at Object.<anonymous> (/app/node_modules/socket.io/lib/store.js:35:41)
    2017-04-17T13:55:16.903232+00:00 app[web.1]:     at Module._compile (module.js:571:32)
    2017-04-17T13:55:16.903232+00:00 app[web.1]:     at Object.Module._extensions..js (module.js:580:10)
    2017-04-17T13:55:16.903233+00:00 app[web.1]:     at Module.load (module.js:488:32)
    2017-04-17T13:55:16.903233+00:00 app[web.1]:     at tryModuleLoad (module.js:447:12)
    2017-04-17T13:55:16.903234+00:00 app[web.1]:     at Function.Module._load (module.js:439:3)
    2017-04-17T13:55:16.903234+00:00 app[web.1]:     at Module.require (module.js:498:17)
    2017-04-17T13:55:16.903235+00:00 app[web.1]:     at require (internal/module.js:20:19)
    2017-04-17T13:55:16.903236+00:00 app[web.1]:     at Object.<anonymous> (/app/node_modules/socket.io/lib/manager.js:16:13)
    2017-04-17T13:55:16.903236+00:00 app[web.1]:     at Module._compile (module.js:571:32)
    2017-04-17T13:56:39.858509+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=invoices-app.herokuapp.com request_id=de360abf-f350-4dca-87ce-af98e458f270 fwd="79.117.186.60" dyno= connect= service= status=503 bytes= protocol=https
    2017-04-17T13:56:40.477926+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=invoices-app.herokuapp.com request_id=9d310798-59aa-42cb-87a5-3ff8ab3f2fef fwd="79.117.186.60" dyno= connect= service= status=503 bytes= protocol=https

的package.json

{
  "private": true,
  "engines": {
    "node": ">=0.10.0"
  },
  "scripts": {
    "test": "gulp test"
  },
  "devDependencies": {
    "apache-server-configs": "^2.11.0",
    "chai": "^2.1.0",
    "connect": "^3.3.4",
    "connect-livereload": "^0.5.3",
    "del": "^1.1.1",
    "gulp": "^3.9.1",
    "gulp-autoprefixer": "^2.1.0",
    "gulp-cache": "^0.2.8",
    "gulp-csso": "^1.0.0",
    "gulp-filter": "^2.0.2",
    "gulp-flatten": "^0.0.4",
    "gulp-if": "^1.2.5",
    "gulp-inject": "^1.2.0",
    "gulp-jscs": "^1.4.0",
    "gulp-jshint": "^1.9.2",
    "gulp-less": "^3.0.1",
    "gulp-livereload": "^3.8.0",
    "gulp-load-plugins": "^0.8.0",
    "gulp-minify-html": "^1.0.0",
    "gulp-ng-annotate": "^0.5.2",
    "gulp-ngdocs": "^0.2.10",
    "gulp-plumber": "^0.6.6",
    "gulp-rename": "^1.2.0",
    "gulp-replace": "^0.5.3",
    "gulp-size": "^1.2.1",
    "gulp-uglify": "^1.1.0",
    "gulp-useref": "^1.1.1",
    "jshint-stylish": "^1.0.1",
    "karma": "^0.12.31",
    "karma-jasmine": "^0.3.5",
    "karma-phantomjs-launcher": "^0.1.4",
    "lazypipe": "^0.2.2",
    "main-bower-files": "^2.5.0",
    "mocha": "^2.1.0",
    "mock-gulp-dest": "^0.1.1",
    "opn": "^1.0.1",
    "serve-index": "^1.6.2",
    "serve-static": "^1.9.1",
    "wiredep": "^2.2.2",
    "yargs": "^3.3.1"
  },
  "dependencies": {}
}

1 个答案:

答案 0 :(得分:0)

自发布以来已经过了一段时间,但我想我会帮助其他人解决这个问题。

当你的业力过时时,Gulp往往会失败。

您目前的版本为0.12.31,此帖的当前版本为karma 1.7.0

解决方案很简单,只需运行:

npm install karma@latest