问题
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