I'm currently trying to push my app to Heroku. I already been able to deploy it a few times, but now I've updated mongoose from ">= 3.5.0" to ">= 3.6.0rc0" in my packages.json file. However, version 3.6 requires mpath and mpromise.
When the slug compilation begins, it uses a cached version of mongoose or something, as my when my application launches, I get "Error: Cannot find module 'mpath'".
I trying to setup a custom buildpack Git that would stop the caching, I just commented out the cache stuff in bin/compile, available here: https://github.com/jValdron/heroku-buildpack-nodejs
Here is an output of the push: http://pastebin.com/L3Yqy2NR
Also, when I removed some dependencies from package.json, if I login with 'heroku run bash', I can see that those removed dependencies in node_modules. I already tried to remove the node_modules folder and do another 'git push', that didn't work either. And those removed deps are still in node_modules.
Anyone have an idea on how to fix this?
EDIT:
Here is my package.json file:
{
"name": "souply-api",
"version": "0.1.0",
"author": "Jason Valdron <jason.valdron@orangesprocket.com>",
"description": "Main gears that runs the Soup.ly application",
"dependencies": {
"bcrypt": ">= 0.7.3",
"express": ">= 3.0.5",
"extend": ">= 1.1.3",
"imagemagick": ">= 0.1.3",
"jade": ">= 0.27.7",
"knox": ">= 0.4.6",
"less": ">= 1.3.1",
"less-middleware": ">= 0.1.9",
"moment": ">= 1.7.2",
"mongoose": ">= 3.6.0rc0",
"mongoose-types": ">= 1.0.3",
"node-native-zip": ">= 1.1.0",
"nodemailer": ">= 0.3.37",
"oauth2orize": ">= 0.1.0",
"passport": ">= 0.1.15",
"passport-local": ">= 0.1.6",
"passport-google": ">= 0.2.0",
"passport-facebook": ">= 0.1.4",
"passport-twitter": ">= 0.1.4",
"passport-http": ">= 0.2.1",
"passport-http-bearer": ">= 0.2.0",
"passport-oauth2-client-password": ">= 0.1.0",
"poor-form": ">= 1.1.3",
"request": ">= 2.12.0",
"socket.io": ">= 0.9.13"
},
"engines": {
"node": "0.8.x",
"npm": "1.1.x"
}
}
Mongoose is set as 3.6.0rc, as previously said. Mpath is a dependencies in Mongoose's package.json file. If I look at my local mongoose package.json file, I can see this:
"dependencies": {
"hooks": "0.2.1"
, "mongodb": "1.2.11"
, "ms": "0.1.0"
, "sliced": "0.0.3"
, "muri": "0.3.0"
, "mpromise": "0.2.0"
, "mpath": "0.1.1"
}
Also, if I login with heroku run bash, and navigate to node_modules/mongoose/node_modules I see that mpath and mpromise is not there.
node_modules was in the Git repo. By removing it from the repo, it worked fine.
you will need to update your package.json to be the latest version of mongoose you are using
you will need to add mpath to your package.json also (before the mongoose entry)
can you post your package.json file?