Я пытаюсь запустить простое приложение для очистки экрана в node.js. Код размещен здесь: https://github.com/anismiles/jsdom-based-screen-scraper http://anismiles.wordpress.com/2010/11/29/node-js-and-jquery-to-scrape -websites /
Сервер запускается нормально, но затем, когда я запускаю на нем запрос, я получаю следующую ошибку. Кто-нибудь знает, почему?
TypeError: Object #
Функция, которая, похоже, выдает ошибку:
function books(app){
app.get('/:query', function(req, res, next) {
res.writeHead(200, { 'Content-Type': 'text/html' });
var rediff = require('./searcher-rediff');
rediff.on('on_book', function(item){
res.write(item + "
");
});
rediff.on('completed', function(){
res.end();
});
rediff.search(escape(req.params.query));
});
}
ОБНОВЛЕНИЕ
Теперь я заметил, что по первому запросу я получаю следующее:
SyntaxError: Unexpected strict mode reserved word
at Module._compile (module.js:369:25)
at Object..js (module.js:380:10)
at Module.load (module.js:306:31)
at Function._load (module.js:272:10)
at require (module.js:318:19)
at Object. (/Users/avishai/Downloads/anismiles-jsdom-based-screen-scraper-f0c79d3/searcher.js:2:15)
at Module._compile (module.js:374:26)
at Object..js (module.js:380:10)
at Module.load (module.js:306:31)
at Function._load (module.js:272:10)