On Windows,
"yarn global add typescript" installs to %LOCALAPPDATA%Yarnconfigglobalnode_modules (actually expanded to "c:users
However, "yarn global bin" shows %LOCALAPPDATA%Yarnbin, or "c:users
What is the expected behavior?
I don't know where you really want to put the global modules. However, since "c:users
Strangely enough, since "yarn config get prefix" yields "undefined", I tried "yarn config set prefix "c:users
Please mention your node.js, yarn and operating system version.
Behaviour is the same for yarn 0.24.6 and 0.26.1, node 8.1.2, Windows 10 1703 - yarn had been installed first by chocolatey, but I tried the msi as well.
For the records - since I've been playing around with the prefix config, I cannot reproduce this bug anymore. I removed the prefix config and it still installs fine.
For me it looks like yarn hadn't been able to write to "c:users
I cannot reproduce this bug anymore. I removed the prefix config and it still installs fine.
Closing then :)
I fixed this by adding the result of yarn global bin to my environment variables for the system (not the user, where it already was, but didn't work).
I fixed this by adding the result of
yarn global binto my environment variables for the system (not the user, where it already was, but didn't work).
this worked perfectly
I know this issue is very old but leaving this here for the next Google search that leads someone here:
I added this to my .bashrc file:
# add this if yarn global packages don't work
export PATH="$(yarn global bin):$PATH"
Then reload the file with:
# path to .bashrc file
. /home/my_username/.bashrc
I know this issue is very old but leaving this here for the next Google search that leads someone here:
I added this to my
.bashrcfile:# add this if yarn global packages don't work export PATH="$(yarn global bin):$PATH"Then reload the file with:
# path to .bashrc file . /home/my_username/.bashrc
thanks this worked perfectly!
Most helpful comment
I fixed this by adding the result of
yarn global binto my environment variables for the system (not the user, where it already was, but didn't work).