为什么 jsdom 抛出类型错误?
Why is jsdom throwing a Type Error?
我使用 jsdom 来解析远程站点,但是当我尝试将它与 node-webkit.js 一起使用时,它抛出错误:
Uncaught TypeError: A 'super' constructor call may only appear as the
first statement of a function, and its arguments may not access
'this'. Other forms are not yet supported.
但是,如果我通过终端使用它,它就可以工作!如何解决?
假设您使用的是最新最好的 jsdom
Note that as of our 7.0.0 release, jsdom requires Node.js 4 or newer (why?). In the meantime you are still welcome to install a release in the 3.x series if you use legacy Node.js versions like 0.10 or 0.12. There are also various releases between 3.x and 7.0.0 that work with various io.js versions
node-webkit 基于 iojs v1.2.0(这是 node.js 4 之前)
我使用 jsdom 来解析远程站点,但是当我尝试将它与 node-webkit.js 一起使用时,它抛出错误:
Uncaught TypeError: A 'super' constructor call may only appear as the first statement of a function, and its arguments may not access 'this'. Other forms are not yet supported.
但是,如果我通过终端使用它,它就可以工作!如何解决?
假设您使用的是最新最好的 jsdom
Note that as of our 7.0.0 release, jsdom requires Node.js 4 or newer (why?). In the meantime you are still welcome to install a release in the 3.x series if you use legacy Node.js versions like 0.10 or 0.12. There are also various releases between 3.x and 7.0.0 that work with various io.js versions
node-webkit 基于 iojs v1.2.0(这是 node.js 4 之前)