我做 npm install -d,然后用 git heroku push master 推送我所有的东西。在我的 heroku 日志中,它会显示:
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
显然,当我在本地部署时,我没有这个问题。我的玉模块中有 mkdirp 模块,它位于我的应用程序的 node_modules 中。
我也有Procfile:
web: node app.js
这是我的 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"
}
}
有人可以请教吗?谢谢!