Huy it
Huy it

Reputation: 271

Nodejs : Kineticjs in nodejs

I install the package Kineticjs in nodejs and have the following error message:

Kinetic.window = Kinetic.document.createWindow();
                                              ^
TypeError: undefined is not a function
    at /kinetic/kinetic.js:608:47

Upvotes: 13

Views: 431

Answers (2)

Anton Stafeyev
Anton Stafeyev

Reputation: 2859

If you have problems like that, you can always read on documentation. also

console.log(typeof Kinetic.document.createWindow);

Also if u do not have access to source code or u can not simply find it. u can always output javascript code via simply reading it with simple I/O

http://serebrov.github.io/html/2013-12-02-node-core-module-source.html

here is example

fs = require('fs');
fs.writeFileSync('fs.js', fs.toString());
fs.writeFileSync('fs.readFileSync.js', fs.readFileSync.toString());

this will copy the source code of fs to new js file that u can read.

Upvotes: 0

Nam Tran
Nam Tran

Reputation: 468

document.createWindowwas removed from jsdom 1.0.0-pre.1. Use jsdom 0.11.1 with kinetic

Upvotes: 3

Related Questions