Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using proto node binary for eslint in VSCode fails #689

Open
austin-raey opened this issue Dec 31, 2024 · 1 comment
Open

Using proto node binary for eslint in VSCode fails #689

austin-raey opened this issue Dec 31, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@austin-raey
Copy link

What version?

0.44.2

Which command?

No response

What happened?

When using the ESLint extension for VSCode, I had recently noticed by default it seems to use the bundled version of Node VSCode ships with (v20.18.1 at the time of writing this).

I figured it would be nice to enforce using the repository's node version, ^22 in my case.

The ESLint extension exports a VSCode configuration item, eslint.runtime, to specify the location of the node binary to use.

When setting this to simply node, however, it seems proto is unable to find what version of node to use. The following is the ESLint extension's output:

[Info  - 12:12:37 PM] ESLint server is starting.
Error: proto::version::undetected

  × Failed to detect an applicable version to run Node.js with. Try pinning a
  │ version with proto pin or passing the version as an argument.
  help: Has the tool been installed?

It seems to me wherever that the process is spawned, proto is unable to find what node to use. I do have PROTO_CONFIG_MODE=upwards in ~/.prototools. I also have a repo-local .node-version, package.json engines, and .prototools version configured.

I'm unsure if this is necessarily an issue with proto itself — I believe it could be configurable. I do know if I set eslint.runtime to the absolute PATH to the node binary installed by proto, e.g., ~/.proto/tools/node/22.12.0/bin/node, it likely would work. However, this is not ideal IMO because it would require other users to have proto installed if I used a VSCode shared config. It would be nice for proto to detect this somehow.

Thanks for any pointers!

Trace logs?

No response

Operating system?

MacOS

Architecture?

arm64

@austin-raey austin-raey added the bug Something isn't working label Dec 31, 2024
@milesj
Copy link
Contributor

milesj commented Dec 31, 2024

@austin-raey My initial thought is that it's running node in a directory that doesn't have some config to traverse to, but that seems odd. Are you able to figure out what the cwd is?

Also, if you're able to somehow set PROTO_LOG=trace, we can figure out exactly what's happening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants