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
Prefer valid user installed version of nodejs if available.
Motivation
Switching between projects sometimes requires using different versions of nodejs. nvm makes switching versions much easier, but because Shopify CLI depends on node's homebrew formula I can no longer switch versions when moving between projects.
Nvm isn't compatible with node's homebrew formula. It'll always prioritize the homebrew formula which prevents any other installed node version from being used.
There is a work around, it requires moving all node versions installed by nvm to the beginning of PATH. This isn't ideal though since these problems will still occur for anyone using the default "out of box" configuration of these tools.
# Dynamically add all node versions installed via nvm to beginning of PATH,# to take precedence over any other node version# (i.e. installed via brew install node or any formula dependencies)forfin$HOME/.nvm/versions/node/*;doif [ -d"$f" ];then
PATH=$f/bin:$PATHfidone
The text was updated successfully, but these errors were encountered:
I think it's also worth noting that the work around I described above isn't perfect. Other core functionality of nvm such as installing new node versions is still broken. It's only a temporary solution at best.
@james-prado This seems to be a local setup issue as the node version picked up by your terminal environment is going to depend on how your binaries resolve. There isn't much we can do on our side to make it so nvm is picked up before homebrew by default.
For anyone in this situation, I moved the snippet that nvm adds to the .zshrc or .bashrc at the end of the file instead of at the beginning so that nvm can init itself after brew is added to the path.
What area(s) will this request affect?
Function
What type of change do you want to see?
Substantial change to existing feature
Overview
Prefer valid user installed version of nodejs if available.
Motivation
Switching between projects sometimes requires using different versions of nodejs. nvm makes switching versions much easier, but because Shopify CLI depends on node's homebrew formula I can no longer switch versions when moving between projects.
Nvm isn't compatible with node's homebrew formula. It'll always prioritize the homebrew formula which prevents any other installed node version from being used.
There is a work around, it requires moving all node versions installed by nvm to the beginning of PATH. This isn't ideal though since these problems will still occur for anyone using the default "out of box" configuration of these tools.
The text was updated successfully, but these errors were encountered: