Is it possible for VS Code to use node version specified by NVM?
I have 6.9.2 installed locally. Even after switching to another version, from the OS X terminal (no
I had this same issue and I found a strange workaround that may be helpful to someone else in the future.
If I do not set eslint.runtime
my system was running node v10.11.0
for eslint server, whereas I wanted it to be running v12.13.0
which I had installed and made default via nvm
.
I found that the v10 version of node was installed by brew
based on @franziga's answer but my desired version of node was installed by nvm
. So, I uninstalled v10.11.0
via brew and closed/reopened VS Code. Strangely, eslint was still reporting that it was started using v10.
I tried running a shell without any changes to my PATH
in any startup scripts, and the version of node was still correctly pointed to v12 as expected, but VS code still starts up v10 for eslint.
I'm not sure how to check the path of the executable that is being run by eslint, and if I open an integrated terminal everything works fine with the expected version of node (v12).
I found that if I set "eslint.runtime": "node"
in settings.json
that it will now use whatever version of node
was active when I opened vscode using code .
on the terminal. Just "node"
- no path.