Last active
November 21, 2020 15:18
-
-
Save yetanotherchris/1e339bd72d4698f70e2c3a02b04fc1c8 to your computer and use it in GitHub Desktop.
Solution to yarn global add does not work on Windows (command not found)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$yarnPath = & yarn global bin | |
$path = [System.Environment]::GetEnvironmentVariable("PATH", [System.EnvironmentVariableTarget]::User) | |
[System.Environment]::SetEnvironmentVariable("PATH", "$path;$yarnPath", [System.EnvironmentVariableTarget]::User) | |
# Your yarn path should appear at the end of the path now | |
[System.Environment]::GetEnvironmentVariable("PATH", [System.EnvironmentVariableTarget]::User) | |
# Try a global command, for example gatsby. If you're using Visual Studio Code, you'll need to restart the IDE | |
gatsby |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment