I copy pasted the example on Github:
app.js:
var Nightmare = require('nightmare');
var vo = require('vo');
vo(function* () {
var nightmare = Nightmare({ show: true });
var link = yield nightmare
.goto('http://yahoo.com')
.type('input[title="Search"]', 'github nightmare')
.click('.searchsubmit')
.wait('.ac-21th')
.evaluate(function () {
return document.getElementsByClassName('ac-21th')[0].href;
});
yield nightmare.end();
return link;
})(function (err, result) {
if (err) return console.log(err);
console.log(result);
});
I did: npm install nightmare vo
Then node --harmony app.js
but nothing outputs:
alex@alex-K43U:~/node/nightmarejs$ node --harmony app.js
alex@alex-K43U:~/node/nightmarejs$
No error messages whatsoever. What can be the problem?
(I'm running node v5.2.0 on Ubuntu.)