JSDOM Node Module Error

I tried to download JSDOM in my project and i got this error message:

/rbd/pnpm-volume/9363f745-90fd-4157-a700-15a077ebd329/node_modules/.registry.npmjs.org/jsdom/16.2.1/node_modules/jsdom/lib/jsdom/living/helpers/dates-and-times.js:235

} catch {
^

SyntaxError: Unexpected token {
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:617:28)
at Object.Module._extensions…js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object. (/rbd/pnpm-volume/9363f745-90fd-4157-a700-15a077ebd329/node_modules/.registry.npmjs.org/jsdom/16.2.1/node_modules/jsdom/lib/jsdom/living/helpers/form-controls.js:18:5)

It seems that is an error inside the package. Sorry buddy. As much as I can do is tell you that a script has an error.

Hi there,

This looks like the issue described here. The problem is caused by an old Node.js version and you should be able to solve it by specifying that you want to use a newer version.

In package.json include:

"engines": {
    "node": "12.x"
},

Hope this helps!

1 Like