Nodejs : Kineticjs in nodejs
Asked Answered
E

2

13

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
Edessa answered 6/4, 2015 at 3:14 Comment(0)
S
3

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

Servia answered 6/4, 2015 at 3:41 Comment(0)
T
0

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.

Tropho answered 4/11, 2016 at 10:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.