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

Set runtime dynamically / to system default #1233

Closed
JakobJingleheimer opened this issue Apr 7, 2021 · 11 comments
Closed

Set runtime dynamically / to system default #1233

JakobJingleheimer opened this issue Apr 7, 2021 · 11 comments
Labels
info-needed Issue requires more information from poster

Comments

@JakobJingleheimer
Copy link

JakobJingleheimer commented Apr 7, 2021

ESlint is using VS Code's old, built-in version of NodeJS (v12) as provided by Electron.

I want to use the current version, which is already installed (via nvm).

As the version will change as I update to new releases, I want to specify the system's version of node (eg which node).

When I run the command "ESLint: Select Node Runtime", the only option is VS Code's built-in.

I tried setting "eslint.runtime": "$(which node)" in settings.json, but the eslint server barfs.

P.S. I read through the README of this repo, and it provided almost no information about this.

@dbaeumer
Copy link
Member

dbaeumer commented Apr 8, 2021

@JakobJingleheimer the settings are managed by VS Code and VS Code itself has no support for variables or $ evaluation. However you should be able to set the value simply to node which should do what you expect.

@dbaeumer dbaeumer added the info-needed Issue requires more information from poster label Apr 8, 2021
@JakobJingleheimer
Copy link
Author

That appears to have sort of worked 🙌

In the Output panel for ESLint, it says it's starting the ESLint server with node v15.14.0. But I'm not sure that's actually true: I was originally tipped off to VS Code ESLint using the old version of node when it complained about an unexpected = character when setting a class property. I found other issues on GitHub saying it was because of an older version of node before it supported class properties (which makes sense).

I'm still get that unexpected character parse error.

I don't get the error when running eslint via Terminal which is definitely using node v15.14.0.

@dbaeumer
Copy link
Member

dbaeumer commented Apr 9, 2021

@JakobJingleheimer can you provide me with a GitHub repository I can clone that demos this?

@dbaeumer
Copy link
Member

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@RebeccaStevens
Copy link

Using "node" doesn't work for me; I need provide the full absolute path.

Note: I'm using WSL, Ubuntu 21.04

@dbaeumer
Copy link
Member

In WSL you need to set the setting on the WSL side as a machine setting.

@RebeccaStevens
Copy link

I'm not sure what you mean by "machine setting"

@dbaeumer
Copy link
Member

capture

The WSL settings in the settings editor.

@RebeccaStevens
Copy link

That is where I set it

@dbaeumer
Copy link
Member

Is node on your path?

@RebeccaStevens
Copy link

Hmm weird. It all seems to be working now despite me not changing any settings since yesterday.
Yesterday I was getting an alert dialog when I started vscode stating that it couldn't start the eslint server with "node" (or something like that).
Ahh, computers are weird sometimes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

3 participants