noduino icon indicating copy to clipboard operation
noduino copied to clipboard

I got a problem with running node srv.web.js

Open chiehming opened this issue 9 years ago • 6 comments

Option origin is not valid. Please refer to the README.

/Users/CMC/noduino/node_modules/kickstart/lib/kickstart.js:55 var router = express.createServer(connect.vhost(kickstart.conf.name, kicksta ^ TypeError: Object function createServer() { function app(req, res, next){ app.handle(req, res, next); } merge(app, proto); merge(app, EventEmitter.prototype); app.route = '/'; app.stack = []; return app; } has no method 'vhost' at Object.exports.listen (/Users/CMC/noduino/node_modules/kickstart/lib/kickstart.js:55:45) at /Users/CMC/noduino/srv.web.js:16:24 at Object.context.execCb (/Users/CMC/noduino/node_modules/requirejs/bin/r.js:1898:33) at Object.Module.check (/Users/CMC/noduino/node_modules/requirejs/bin/r.js:1114:51) at Object.Module.enable (/Users/CMC/noduino/node_modules/requirejs/bin/r.js:1391:22) at Object.Module.init (/Users/CMC/noduino/node_modules/requirejs/bin/r.js:1022:26) at null._onTimeout (/Users/CMC/noduino/node_modules/requirejs/bin/r.js:1664:36) at Timer.listOnTimeout as ontimeout

Please help me, thanks!

chiehming avatar Jul 23 '14 18:07 chiehming

I have the same problem. Did you find a solution?

benwilhelm avatar Sep 01 '14 22:09 benwilhelm

Same issue here. No solution found yet.

xixao avatar Sep 08 '14 14:09 xixao

same here. I have an idea of the bug. It's the version of the kickstart package, and all others packages. You should set the current version works with your project, no * because if external modules have an update with deprecated or removed functions, your work crash.

throrin19 avatar Sep 12 '14 21:09 throrin19

Same issue here. Anyone have a solution? node srv.web.js Option origin is not valid. Please refer to the README.

/Users/joeblow/nodejs/noduino/node_modules/kickstart/lib/kickstart.js:55 var router = express.createServer(connect.vhost(kickstart.conf.name, kicksta ^ TypeError: Object function createServer() { function app(req, res, next){ app.handle(req, res, next); } merge(app, proto); merge(app, EventEmitter.prototype); app.route = '/'; app.stack = []; return app; } has no method 'vhost'

bobdauth avatar Sep 13 '14 01:09 bobdauth

@throrin19, you're spot on. It's a problem with the dependencies defined in the NPM Kickstart module. Kickstart hasn't been updated in over two years and it's requiring the newest versions of Express and Connect, which have changed their APIs. To resolve it, you'll need to manually change the package.json file within the Kickstart module to require appropriate versions of Express and Connect.

Open up node_modules/kickstart/package.json and change the following lines (roughly 38/39)

"connect": ">=1.8.4",
"express": ">=2.5.11",

to

"connect": "1.8.4",
"express": "2.5.11",

Then you need to remove and reinstall Kickstart's dependencies. Open your terminal and CD to your noduino directory, then...

$ cd node_modules/kickstart
$ rm -rf node_modules
$ npm install
$ cd ../..
$ node srv.web.js
//.. should start server on port 8080

I'll be submitting a pull request to the Kickstart module to correct the issue. Good Luck!

benwilhelm avatar Sep 13 '14 02:09 benwilhelm

@benwilhelm it really helps me!

wesleysui avatar Oct 02 '14 09:10 wesleysui