2
我瘋了,試圖弄清楚這一點。我有一個使用Express和MongoDB(mongoose)的node.js應用程序。它在當地運行得非常好。我似乎毫無問題地將它部署到了heroku,但是當我試圖實際啓動應用程序時,它崩潰了。 Heroku的日誌這樣說:在heroku上運行的Node.js應用程序 - 無法找到模塊./http
macbook-pro-4:FF_Courtney cmitchell$ heroku logs
2012-10-29T19:31:27+00:00 heroku[web.1]: State changed from crashed to starting
2012-10-29T19:31:30+00:00 heroku[web.1]: Starting process with command `node web.js`
2012-10-29T19:31:31+00:00 app[web.1]:
2012-10-29T19:31:31+00:00 app[web.1]: module.js:340
2012-10-29T19:31:31+00:00 app[web.1]: throw err;
2012-10-29T19:31:31+00:00 app[web.1]: Error: Cannot find module './http'
2012-10-29T19:31:31+00:00 app[web.1]: ^
2012-10-29T19:31:31+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:338:15)
2012-10-29T19:31:31+00:00 app[web.1]: at Function.Module._load (module.js:280:25)
2012-10-29T19:31:31+00:00 app[web.1]: at Module.require (module.js:362:17)
2012-10-29T19:31:31+00:00 app[web.1]: at require (module.js:378:17)
2012-10-29T19:31:31+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/express/node_modules/connect/lib/connect.js:13:18)
2012-10-29T19:31:31+00:00 app[web.1]: at Module._compile (module.js:449:26)
2012-10-29T19:31:31+00:00 app[web.1]: at Object.Module._extensions..js (module.js:467:10)
2012-10-29T19:31:31+00:00 app[web.1]: at Module.load (module.js:356:32)
2012-10-29T19:31:31+00:00 app[web.1]: at Function.Module._load (module.js:312:12)
2012-10-29T19:31:31+00:00 app[web.1]: at Module.require (module.js:362:17)
2012-10-29T19:31:32+00:00 heroku[web.1]: Process exited with status 1
我有我的依賴關係的文件的package.json:
{
"name": "favorite-failure",
"version": "0.0.1",
"dependencies": {
"express": "2.5.6",
"ejs" : "latest",
"mongoose" : "3.3.1",
"request" : "2.11.4",
"moment" : "1.7.2",
"mongodb" : "0.9.6-7",
"connect-mongodb": ">= 1.1.3"
},
"engines": {
"node": ">= 0.8.12",
"npm": ">= 1.1.49"
}
}
我有點新本,所以任何幫助將不勝感激。謝謝!
我不需要 - 這裏是我的「要求」:var express = require('express'); var mongoose = require('mongoose'); var schema = mongoose.Schema; var requestURL = require('request'); var moment = require('moment'); var ejs = require('ejs'); //嵌入式JavaScript模板引擎 – CourtneyM