Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
chiehming opened this issue Jul 23, 2014 · 6 comments
Open

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

chiehming opened this issue Jul 23, 2014 · 6 comments

Comments

@chiehming
Copy link

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!

@benwilhelm
Copy link

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

@xixao
Copy link

xixao commented Sep 8, 2014

Same issue here. No solution found yet.

@throrin19
Copy link

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.

@bobdauth
Copy link

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'

@benwilhelm
Copy link

@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!

@wesleysui
Copy link

@benwilhelm it really helps me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants