Couchbase on Heroku

牧云@^-^@ 提交于 2020-01-14 05:39:06

问题


This might be a general question, but I have a simple "gym log" app, written in node and I am using Couchbase as the database. Everything works when I run it on my machine. The problem arises when after I've deployed it to Heroku and try to run it. When I check the logs I get the error that module couchbase could not be found.

Do I have to add an add-on to heroku or define couchbase as a dependency in my package.json for my app to work on heroku?

Could someone give me some pointers please?

Here is the link to all my code: github/MMRibot/loGym


回答1:


The error "module couchbase could not be found" means your Node app can't find the couchbase module. You most likely installed it locally with "npm install couchbase", so it works on your machine. To have it working on Heroku, you have to add the couchbase module dependency to your package.json file.

  "dependencies": {
    "hapi": "^6.0.2",
    "joi": "^4.6.1",
    "request": "^2.37.0",
    "underscore": "^1.6.0",
    "couchbase": "*"
  }

Replace "*" with a specific version if you don't want to use the latest (2.0.3 as of this writing.)



来源:https://stackoverflow.com/questions/26266797/couchbase-on-heroku

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!