marcelduran / yslow

YSlow analyzes web pages and suggests ways to improve their performance based on a set of rules for high performance web pages.
yslow.org
BSD 3-Clause "New" or "Revised" License
2.2k stars 382 forks source link

[Bugfix] fix jsdom bug in node and nodeserver package #201

Closed nlzet closed 1 year ago

nlzet commented 5 years ago

Hi,

I'm trying to use the node version of yslow, but I'm running into some trouble regarding jsdom. I suppose there are newer versions, matching the "jsdom": ">=0.2.10"dependency, that are not quite compatible.

I'm currently getting version 12.2.0 which raises the error: TypeError: require(...).jsdom is not a function. This error can be fixed with this PR, can you check if this is the desired solution ?

nlzet commented 5 years ago

With some further experimenting I found that it did work when using node 6 and explicitly loading jsdom 3.0.2. So this PR might break older versions.

Suppose a better fix is to explicitly lock jsdom to a specific version, and document/restrict te required version of nodejs.