[Bug] extension-vscode: Node and npm not found
🐞 Bug report
Description
Whenever I open my VS Code with the webhint extension enabled, I get greeted with the following message: “Ensure node and npm are installed to enable webhint to analyze source files.” As you can see in the attached screenshot, I indeed have both installed, however the extension does not work.
Details
- OS: macOS 15.0.1
- VS Code: 1.94.2
- Extension: 2.1.14
- Node.js: 20.18.0 (via
fnm) - npm: 10.8.2 (via
fnm)
Hi @robinloeffel,
Thanks for reporting this, I'll take a look. As a workaround you can use the Microsoft Edge Devtools extension for VSCCode. Webhint is part of it and could potentially solve your issue. Just please uninstall the webhint extension first as having both could lead to undesired behavior (we also have an open bug for this).
Same here. To add details, I installed n via homebrew, which locates node's binary to: /opt/homebrew/bin/node
Same here, but on a Windows machine.
Same issue here (Debian 12.12, VSCodium 1.104.16282 flatpak, extension 2.1.14, node 22.18.0, npm 10.9.3). I looked in the output and found:
Error loading "hint" package from <project directory>
Trying to load shared version
Error loading shared "hint" package
Error: Cannot find module 'hint'
(...)
Installing shared version of "hint"
Unable to install shared webhint instance Error: spawn npm ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:285:19)
at onErrorNT (node:internal/child_process:483:16)
at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn npm',
path: 'npm',
spawnargs: [ 'init', '-y' ]
}
Unable to load shared webhint instance Error: Cannot find module 'hint'
So there's another potential workaround - it does work for me after running npm i -D hint and restarting extensions.
Incidentally, has webhint been abandoned? Even dependabot seems to have given up on it 11 months ago, and the install came with 11 deprecation warnings and 70 vulnerabilities.