So I've been working with Node.js on C9 recently and ran into this problem in a javascript file:
jsdom.env("", function(err, window) {
TypeError: jsdom.env is not a function
Here is my code:
var jsdom = require('jsdom');
var $;
jsdom.env("", function(err, window) {
console.log("what");
if (err) {
console.error(err);
return;
}
$ = require("jquery")(window);
$.ajax(settings).done(function (response) {
console.log(response);
});
});
I updated all my dependencies as well as Node itself but still get this problem. Does anyone know what's up?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…