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
When running vite setup I expect volta bin path /Users/username/.volta/bin to be added before brew bin path /opt/homebrew/bin.
But instead volta path added after which makes brew node binary override voltas.
So when running node ... command volta is not used.
Reproduce like this
❯ which node
/opt/homebrew/bin/node
❯ echo$PATH# added new lines in output of this command to make it more readable in PR
/Users/username/.sdkman/candidates/java/current/bin:
/Users/username/.bun/bin:
/opt/homebrew/bin:
/opt/homebrew/sbin:
/Users/username/.bin:
/usr/local/bin:
/System/Cryptexes/App/usr/bin:
/usr/bin:
/bin:
/usr/sbin:
/sbin:
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:
/Library/Apple/usr/bin:
/Applications/VMware Fusion.app/Contents/Public:
/Applications/iTerm.app/Contents/Resources/utilities:
/Applications/Visual Studio Code.app/Contents/Resources/app/bin:
/Applications/Visual Studio Code.app/Contents/Resources/app/bin
❯ volta setup
success: Setup complete. Open a new terminal to start using Volta!
volta setup above adds the volta path to .zshenv since PR #1537
if you then open a new terminal as mentioned and check what node version is used you will see volta bin path is added after brew bin path
❯ which node
/opt/homebrew/bin/node
❯ echo$PATH# added new lines in output of this command to make it more readable in PR
/Users/username/.sdkman/candidates/java/current/bin:
/Users/username/.bun/bin:
/opt/homebrew/bin:
/opt/homebrew/sbin:
/Users/username/.bin:
/usr/local/bin:
/System/Cryptexes/App/usr/bin:
/usr/bin:
/bin:
/usr/sbin:
/sbin:
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:
/Library/Apple/usr/bin:
/Applications/VMware Fusion.app/Contents/Public:
/Users/username/.volta/bin: <--- volta path added incorrectly after brew path
/Applications/iTerm.app/Contents/Resources/utilities:
/Applications/Visual Studio Code.app/Contents/Resources/app/bin:
/Applications/Visual Studio Code.app/Contents/Resources/app/bin
open new terminal and see that correct node is used and volta path is added correctly before brew bin path
❯ which node
/Users/username/.volta/bin/node
❯ echo$PATH# added new lines in output of this command to make it more readable in PR
/Users/username/.volta/bin: <--- volta path added correctly before brew path
/Users/username/.sdkman/candidates/java/current/bin:
/Users/username/.bun/bin:
/opt/homebrew/bin:
/opt/homebrew/sbin:
/Users/username/.bin:
/usr/local/bin:
/System/Cryptexes/App/usr/bin:
/usr/bin:
/bin:
/usr/sbin:
/sbin:
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:
/Library/Apple/usr/bin:
/Applications/VMware Fusion.app/Contents/Public:
/Users/username/.volta/bin:
/Applications/iTerm.app/Contents/Resources/utilities:
/Applications/Visual Studio Code.app/Contents/Resources/app/bin:
/Applications/Visual Studio Code.app/Contents/Resources/app/bin
Worth noting is that I have not installed node with brew directly. Its installed as a transative dependency in some brew formulas, e.g. mongodb-community. So I cannot uninstall node to get volta setup to work.
@gautamprikshit1 @chriskrycho PR #1537 is causing a bug with brew
When running
vite setup
I expect volta bin path/Users/username/.volta/bin
to be added before brew bin path/opt/homebrew/bin
.But instead volta path added after which makes brew node binary override voltas.
So when running
node ...
command volta is not used.Reproduce like this
volta setup
above adds the volta path to.zshenv
since PR #1537if you then open a new terminal as mentioned and check what node version is used you will see volta bin path is added after brew bin path
Fix with
Add the setup lines to
open new terminal and see that correct node is used and volta path is added correctly before brew bin path
Worth noting is that I have not installed node with brew directly. Its installed as a transative dependency in some brew formulas, e.g.
mongodb-community
. So I cannot uninstall node to get volta setup to work.Possible solution
in
volta/src/command/setup.rs
Line 129 in 40a6b89
change
to
Since think on macs the
.zshenv
does not exist by default (not 100% sure).alternative is to revert and use only zshrc.exists() check
The text was updated successfully, but these errors were encountered: