Node.JS and jQuery - typeError createWindow is not a function

I am trying to play with node.js and send an xmlhttp request to the server from my server.js file using the node.js server object.

I defined the following at the beginning of my .js file:

var http = require('http');
var jsdom = require('jsdom');
var $ = require('jquery');

When I try to run a .js file using the nodejs console, I get the following error:

require (...). jsdom (...). createWindow is not a function

Is there something obvious that I'm missing?

I searched for the answers but no longer received.

+4
source share
2 answers

Thanks for the answer.

It seemed like it was a known bug in the old version of jquery. Reinstalling the latest version of jQuery in node.js solved this problem.

0
source

package.json dependencies, jQuery . , 1.7.4

. JQuery 3.2.1, .

,

npm install jQuery

.

npm install jQuery

.

Q.

0

Source: https://habr.com/ru/post/1624466/


All Articles