webhintio / hint

πŸ’‘ A hinting engine for the web

Home Page:https://webhint.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug] Object.fromEntries is not a function

koaning opened this issue Β· comments

🐞 Bug report

Description

I wanted to give the project a spin. So I installed it, and it gave an error.

> npx hint https://webhint.io
Object.fromEntries is not a function

Details

I just installed it using npm on a M1 Mac.

npm install hint --save-dev
npm WARN saveError ENOENT: no such file or directory, open '/Users/vincentwarmerdam/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/vincentwarmerdam/package.json'
npm WARN ajv-formats@2.1.1 requires a peer of ajv@^8.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN tsutils@3.21.0 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
npm WARN ws@8.5.0 requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN ws@8.5.0 requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencies yourself.
npm WARN vincentwarmerdam No description
npm WARN vincentwarmerdam No repository field.
npm WARN vincentwarmerdam No README data
npm WARN vincentwarmerdam No license field.

+ hint@6.2.0
updated 1 package and audited 1085 packages in 6.114s
found 0 vulnerabilities

@koaning any chance you're using a version of node less than 12? I see from MDN that fromEntries isn't in older versions of node and webhint may have picked up a dependency update that relies on it. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/fromEntries#browser_compatibility

Also, it's probably worth noting we're planning on requiring node 14+ soon.

Ah, in that case the readme has a statement that might need to be updated:

To use it from the CLI you will need to install Node.js (v10.x or later) on your machine, and you can use npx to test it.

I'm running:

> node --version
v11.0.0

@koaning good call-out, thanks!

I've updated the docs to specify Node 14+ in the same PR where we're updating our min node version in the configs:

Closing this issue as this requirement should be clearer going forward.