I do npm install -d, and then push all my stuff with git heroku push master.
In my heroku logs, it would display:
2012-05-01T00:21:37+00:00 heroku[web.1]: Starting process with command `node app.js`
2012-05-01T00:21:39+00:00 app[web.1]:
2012-05-01T00:21:39+00:00 app[web.1]: node.js:201
2012-05-01T00:21:39+00:00 app[web.1]: ^
2012-05-01T00:21:39+00:00 app[web.1]: Error: Cannot find module 'mkdirp'
2012-05-01T00:21:39+00:00 app[web.1]: at Function._load (module.js:279:25)
2012-05-01T00:21:39+00:00 app[web.1]: at Module.require (module.js:354:17)
2012-05-01T00:21:39+00:00 app[web.1]: throw e; // process.nextTick error, or 'error' event on first tick
2012-05-01T00:21:39+00:00 app[web.1]: at Function._resolveFilename (module.js:332:11)
2012-05-01T00:21:39+00:00 app[web.1]: at require (module.js:370:17)
2012-05-01T00:21:39+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/stylus/lib/middleware.js:16:14)
2012-05-01T00:21:39+00:00 app[web.1]: at Module._compile (module.js:441:26)
2012-05-01T00:21:39+00:00 app[web.1]: at Object..js (module.js:459:10)
2012-05-01T00:21:39+00:00 app[web.1]: at Module.load (module.js:348:31)
2012-05-01T00:21:39+00:00 app[web.1]: at Function._load (module.js:308:12)
2012-05-01T00:21:39+00:00 app[web.1]: at Module.require (module.js:354:17)
2012-05-01T00:21:40+00:00 heroku[web.1]: Process exited with status 1
2012-05-01T00:21:40+00:00 heroku[web.1]: State changed from starting to crashed
Obviously, I have none of this problem when I deploy locally.
I have the mkdirp module within my jade module, which is inside the node_modules of my application.
I also have the Procfile:
web: node app.js
Here is my package.json:
{
"name": "gemini"
, "version": "0.0.1"
, "contributors": [
{ "name": "****", "email": "****" }
]
, "private": true
, "engines": { "node": ">= 0.2.0" }
, "dependencies": {
"express": "2.5.1"
, "stylus": ">= 0.17.0"
, "jade": "0.3.0"
}
}
Can anyone please advise? Thanks!
I fixed it by doing npm install mkdirp and then pushing.
I get a warning though for missing mkdirp and defaulting to the one that I just installed.
Probably because I know that I also definitely have mkdirp inside the node_modules of both jade and stylus?
In any case, the app is deployed now.