0

I made the switch to nvm-windows. I installed all of my global packages using npm for each version of Node that I have installed. I can verify all of these packages are installed in:

C:\Users\[username]\AppData\Roaming\nvm\[node version]

I also installed Yarn globally for each version of Node:

nvm use latest
npm install -g yarn
nvm use lts
npm install -g yarn
nvm use 16.20.0
npm install -g yarn

Etc...

What I don't quite understand is why all yarn globally installed packages get dropped in the yarn global bin folder:

C:\Users\[username]\AppData\Local\Yarn\bin

How do global yarn packages work with different versions of Node (I.E. If I switch from latest to lts)?

For example, I installed nodemon via yarn global add nodemon. But when I type nodemon into the command-line, it's not recognized.

I can add C:\Users\[username]\AppData\Local\Yarn\bin to my PATH environment variable, but this doesn't make sense to me. Shouldn't global Yarn installs be tied to the version of Node that's currently selected by nvm-windows?

I think I have the same issue as this post. All yarn global packages are installed in the same directory no matter what version of Node that's selected with nvm-windows. To steal a direct quote from another post:

Yarn insists on some kind of global install location (separate from what nvm controlled node versions see).

In short: How am I supposed to use Yarn with nvm-windows? Should I just stick to npm?

fmotion1
  • 237
  • 4
  • 12

0 Answers0