Skip to content

Instantly share code, notes, and snippets.

@yetanotherchris
Last active November 21, 2020 15:18
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
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)
$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