我正在尝试完成本教程:
http://www.thinkster.io/angularjs/GUIDJbpIie/angularjs-tutorial-learn-to-build-modern-web-apps
它使用此处找到的mean-stripdown repo:
https://github.com/msfrisbie/mean-stripdown
但是当我在运行node server
后尝试运行npm install
时,我收到以下错误:
Error: Most middleware (like session) is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.
我认为这是由于Express 4所以我将依赖项中的"express": "latest"
更改为"express": "3.x"
现在,当我运行node server
时,我在控制台中收到以下内容:
jamesontrinker@jamesons-imac ~/projects/mean-stripdown (master)*$ node server
connect deprecated multipart: use parser (multiparty, busboy, formidable) directly
node_modules/express/node_modules/connect/lib/middleware/bodyParser.js:56:20
connect deprecated limit: Restrict request size at location of read node_modules/express/node_modules/connect/lib/middleware/multipart.js:86:15
connect deprecated methodOverride: use method-override module directly config/express.js:44:21
Express app started on port 3000
events.js:72
throw er; // Unhandled 'error' event
^
Error: failed to connect to [localhost:27017]
这是我的package.json:
{
"name": "mean"
, "description": "Mongo"
, "version": "1.0.0"
, "private": false
, "author": "MEAN - A Modern Stack: MongoDB, ExpressJS, AngularJS, NodeJS. (BONUS: Passport User Support)."
, "engines": {
"node": "0.10.x"
, "npm": "1.2.x"
}
, "scripts": {
"start": "NODE_ENV=development ./node_modules/.bin/nodemon server.js",
"test": "NODE_ENV=test ./node_modules/.bin/mocha --reporter spec test/test-*.js"
}
, "dependencies": {
"express": "3.x"
, "jade": "latest"
, "mongoose": "latest"
, "connect-mongo": "latest"
, "connect-flash": "latest"
, "passport": "latest"
, "passport-local": "latest"
, "passport-facebook": "latest"
, "passport-twitter": "latest"
, "passport-github": "latest"
, "passport-google-oauth": "latest"
, "imager": "latest"
, "notifier": "latest"
, "underscore": "latest"
, "gzippo": "latest"
, "async": "latest"
, "view-helpers": "latest"
, "forever": "latest"
, "mean-logger": "latest"
, "bower": "latest"
}
和模块依赖关系:
/**
* Module dependencies.
**/
var express = require('express')
, fs = require('fs')
, passport = require('passport')
, logger = require('mean-logger')
非常感谢。