kirbysayshi / vash-express-example

An example express app built using Vash
14 stars 11 forks source link

Unable to start new project with Vash #3

Open paranoid-android opened 9 years ago

paranoid-android commented 9 years ago

Hello,

I'm attempted to start a new Node.js app using Vash. I following this example. I copied the contents of app.js. My package.json is slightly different. Mine looks like this:

{
  "name": "MyApp",
  "version": "1.0.0",
  "private": true,
  "dependencies": {
    "body-parser": "^1.13.3",
    "cookie-parser": "^1.3.5",
    "debug": "^2.2.0",
    "errorhandler": "^1.4.2",
    "express": "^4.13.3",
    "express-session": "^1.11.3",
    "method-override": "^2.3.5",
    "morgan": "^1.6.1",
    "multer": "^1.0.3",
    "serve-favicon": "^2.3.0",
    "vash": "^0.9.3"
  },
  "scripts": {
    "start": "node app"
  }
}

After running npm install, I run node app.js. At that point, I get an error:

/Users/username/Website/node_modules/express/lib/application.js:209
    throw new TypeError('app.use() requires middleware functions');
          ^
TypeError: app.use() requires middleware functions
    at EventEmitter.use (/Users/username/Website/node_modules/express/lib/application.js:209:11)
    at Object.<anonymous> (/Users/username/Website/app.js:31:5)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3

I do not understand why I am getting this error. I also do not understand how to fix it. How do I fix this error?

Thank you!

kirbysayshi commented 9 years ago

Did you clone this project, or copy the code from app.js? There are more files than just app.js required, such as the routes and views. I just tried cloning this repo, and then npm install, and it started up successfully.

mrmartineau commented 8 years ago

I just cloned this repo and am experiencing the same issues.. I am going to try to debug it and figure out the issue.

mrmartineau commented 8 years ago

It looks like multer (line 35) was causing the issue. I have disabled it and the app now works. I don't need it at this point so I am not going to find a fix just yet.