version-fox / vfox

A cross-platform and extendable version manager with support for Java, Node.js, Flutter, .Net & more
https://vfox.lhan.me
Apache License 2.0
2.85k stars 102 forks source link

[BUG]: Error when running "vfox use -g" in Git Bash #292

Closed colececil closed 5 months ago

colececil commented 5 months ago

Version vfox 0.5.3 (installed using scoop) OS Windows 11

Describe the bug When I try to run vfox use -g from Git Bash, I get an error saying the system can't find the specified path (even though the path exists). Running vfox use without the -g flag works fine, and running it with -s or -p also work fine. I've tried with two separate plugins (golang and nodejs), and I see the same issue with both.

Examples

$ vfox use -g golang
Please select a version of golang:
  -> 1.22.3
failed to read bin paths:/c/Users/colec/.version-fox/cache/golang/current/bin: open /c/Users/colec/.version-fox/cache/golang/current/bin: The system cannot find the path specified.
$ ls -al /c/Users/colec/.version-fox/cache/golang/current/bin
total 15372
drw-rw-rw-   2 colec 0        0 2024-05-25 21:21 .
drw-rw-rw-  10 colec 0     4096 2024-05-25 21:21 ..
-rwxrwxrwx   1 colec 0 12957696 2024-05-25 21:21 go.exe
-rwxrwxrwx   1 colec 0  2775040 2024-05-25 21:21 gofmt.exe
$ vfox use -g nodejs
Please select a version of nodejs:
  -> 20.13.1
failed to read bin paths:/c/Users/colec/.version-fox/cache/nodejs/current: open /c/Users/colec/.version-fox/cache/nodejs/current: The system cannot find the path specified.
$ ls -al /c/Users/colec/.version-fox/cache/nodejs/current/
total 67896
drw-rw-rw-  3 colec 0     4096 2024-05-25 21:37 .
drw-rw-rw-  3 colec 0        0 2024-05-25 21:37 ..
-rw-rw-rw-  1 colec 0    55087 2024-05-25 21:37 CHANGELOG.md
-rw-rw-rw-  1 colec 0      334 2024-05-25 21:37 corepack
-rwxrwxrwx  1 colec 0      218 2024-05-25 21:37 corepack.cmd
-rwxrwxrwx  1 colec 0     3033 2024-05-25 21:37 install_tools.bat
-rw-rw-rw-  1 colec 0   119618 2024-05-25 21:37 LICENSE
-rwxrwxrwx  1 colec 0 69266072 2024-05-25 21:37 node.exe
drw-rw-rw-  4 colec 0        0 2024-05-25 21:37 node_modules
-rwxrwxrwx  1 colec 0      702 2024-05-25 21:37 nodevars.bat
-rw-rw-rw-  1 colec 0     2073 2024-05-25 21:37 npm
-rwxrwxrwx  1 colec 0      538 2024-05-25 21:37 npm.cmd
-rw-rw-rw-  1 colec 0     2073 2024-05-25 21:37 npx
-rwxrwxrwx  1 colec 0      538 2024-05-25 21:37 npx.cmd
-rw-rw-rw-  1 colec 0    39557 2024-05-25 21:37 README.md
colececil commented 5 months ago

Thank you, @aooohan! 🙏