-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Yarn global packages are installed unproperly #1641
Description
Yarn that was installed via Scoop doesn't install global packages properly.
TL;DR: Suggested hot fix workaround
If you are a Scoop user and want to fix the bug ASAP than you may add %LOCALAPPDATA%\Yarn\config\global\node_modules\.bin to your PATH environment variable.
Test scenario:
I have Windows 10 desktop with fresh Scoop installed. After that:
scoop install nodejs yarn
yarn global add http-serverThe last command generated file $env:HOMEPATH\scoop\apps\yarn\current\bin\http-server.cmd.
Scoop previously added this file's folder to $env:PATH.
This file contains only 1 non-empty line:
@"%~dp0\..\..\..\..\AppData\Local\Yarn\config\global\node_modules\.bin\http-server.cmd" %*The command http-server returns following output:
The system cannot find the path specified.
Bug source
I've tried to find the bug reason. So I've edited the file and added 1 more ..\ right before AppData:
@"%~dp0\..\..\..\..\..\AppData\Local\Yarn\config\global\node_modules\.bin\http-server.cmd" %*The resulting file works.
The same issue is reproduced with any global Yarn package. We have to figure out if this a Scoop or Yarn issue.