You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm unable to use this extension in VSCode due to the extension not being able to find the node executable. In my environment I use fnm which is configured properly to run in all of my shells. Other plugins such as those for Jest and the VSCode debuger have had similar issues with version managers but normally there is a way to configure the extension to resolve the node path through a specific configuration.
Reproduction
Ensure no other Node.js installations exist
Install fnm (winget install "Schniz.fnm")
Install VSCode
Open a project which uses vitest
Install the vitest-dev extension through the extension in VSCode
Output
[Error 8:27:31 AM] [Error Error] Unable to find 'node' executable.
Make sure to have Node.js installed and available in your PATH.
Current PATH: 'C:\Program Files\OpenSSH\;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\java8path;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\IBM\Client Access\Emulator;C:\Program Files (x86)\IBM\Client Access\Shared;C:\Program Files (x86)\IBM\Client Access\;C:\Windows\CCM;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\Perforce\;C:\Program Files\Seq\;C:\Program Files\Seq\Client\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\dotnet\;C:\Program Files\PuTTY\;C:\Program Files\PowerShell\7\;C:\Users\myuser\AppData\Local\Microsoft\WindowsApps;C:\Users\myuser\.dotnet\tools;C:\Users\myuser\AppData\Local\Microsoft\dotnet\;C:\Users\myuser\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\myuser\AppData\Local\Programs\Git\cmd;C:\tools\java-1.8.0-openjdk-1.8.0.352-2.b08.redhat.windows.x86_64;C:\Users\myuser\.jabba;C:\Users\myuser\.jabba\jdk\17.0.1-redhat\bin;C:\tools\node-v18.12.0-win-x64-disabled;C:\tools\node-v16.15.0-win-x64-disabled;C:\tools\node-v16.14.0-win-x64-disabled;C:\tools\node-v12.14.1-win-x64-disabled;C:\Users\myuser\AppData\Local\nvs;C:\tools\python-3.10.4-embed-amd64;C:\tools\python-2.7.16.amd64-pdb;C:\tools\apache-maven-3.9.2\bin;C:\tools\apache-maven-4.0.0-alpha-5\bin;C:\tools\maven;C:\Program Files\Azure Data Studio\bin;C:\Users\myuser\AppData\Local\Microsoft\WinGet\Packages\Schniz.fnm_Microsoft.Winget.Source_8wekyb3d8bbwe\;C:\tools\libwebp-1.3.2-windows-x64\bin;C:\Users\myuser\.dotnet\tools'.
Version
v1.2.18
Validations
Check that you are using the latest version of the extension
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Ok, so searching the issues didn't turn up any results for me initially but after briefly reading through the README.md I see the the vitest.nodeExecutable option that is provided. For version managers which determine the version through the shell context though I'm not sure how to make this work effectively for a large number of separate projects which may use different versions of node.
Based on my limit knowledge on this extension, one option might be to default to a single version of node on the system for the purpose of running this extension by taking advantage of the vitest.nodeExecutable to hard code a path to a specific version of node installed through fnm. I've had issues doing a similar thing with a Jest extension in that it was sensitive to different versions of node across projects. Another option would be to potentially have vitest launch node on Windows with something similar to ShellEexecute or through the default shell (Powershell on Windows 10+) instead of running the node executable directly.
It appears that this may be a similar issue to the on pointed out in #381 which didn't seem to come to a great conclusion but it also looks like some related discussion is happening in #383 but with a different focus on on intermittent issues.
Describe the bug
I'm unable to use this extension in VSCode due to the extension not being able to find the node executable. In my environment I use fnm which is configured properly to run in all of my shells. Other plugins such as those for Jest and the VSCode debuger have had similar issues with version managers but normally there is a way to configure the extension to resolve the node path through a specific configuration.
Reproduction
winget install "Schniz.fnm"
)Output
Version
v1.2.18
Validations
The text was updated successfully, but these errors were encountered: