Войти с помощью github
Форум /

подскажите пожалуйста в чем ошибка

код:

    var bemtreeTemplate = fs.readFileSync(path.join('.',pathToBundle, 'index.bemtree.js'), 'utf-8');
    var context = vm.createContext({
        console: console,
        require: require,
        Vow: vow
    });
    vm.runInContext(bemtreeTemplate, context);

ошибка:

node ./desktop.bundles/index/index.node.js
evalmachine.<anonymous>:85
       if('onreadystatechange' in doc.createElement('script')) { // ie6-ie8
                                      ^

TypeError: Cannot read property 'createElement' of undefined
    at evalmachine.<anonymous>:85:39
    at evalmachine.<anonymous>:104:7
    at Object.__vow_init (evalmachine.<anonymous>:1331:3)
    at buildBemXjst (evalmachine.<anonymous>:1335:12)
    at evalmachine.<anonymous>:1603:25
    at evalmachine.<anonymous>:1605:3
    at Object.exports.runInContext (vm.js:44:17)
    at /home/rustam/work/newkent/desktop.blocks/server/server.node.js:18:5
    at pendingRequires.push.cb (/home/rustam/work/newkent/desktop.bundles/index/index.node.js:88:32)
    at onDeclResolved (/home/rustam/work/newkent/desktop.bundles/index/index.node.js:175:29)