What is the current behavior?
Running any command for yarn results in the following error:
-bash: yarn: command not found
If the current behavior is a bug, please provide the steps to reproduce.
brew install yarn --without-node
yarn help
)What is the expected behavior?
Would expect the commands to register automatically with /usr/local/bin
to yarn
Looking into the issue looks like it is not aliased correctly in the /usr/local/bin
. It is actually listed as yarnpkg
. That being said I am able to run all yarn commands as yarnpkg help
when it should just be yarn help
Please mention your node.js, yarn and operating system version.
@Daniel15 do you know how the Homebrew install works?
Did you get any errors while installing?
@rally25rs The configuration for Yarn in Homebrew is here: https://github.com/Homebrew/homebrew-core/blob/master/Formula/yarn.rb. It looks like it's supposed to install both yarn
and yarnpkg
executables:
(bin/"yarn").write_env_script "#{libexec}/bin/yarn.js", :PREFIX => HOMEBREW_PREFIX
(bin/"yarnpkg").write_env_script "#{libexec}/bin/yarn.js", :PREFIX => HOMEBREW_PREFIX
No errors while installing.
Not to familiar with how homebrew installs, but I have to use the flag --without-node
since I'm using NVM per the install docs. Not sure if that would make any difference to it registering both yarn
and yarnpkg
Does your echo $PATH
contain /usr/local/bin
?
If so I'd guess the linking step failed during the installation of yarn
for some reasons. Try to rerun it with brew unlink yarn && brew link yarn
and see if you get any errors.
Thanks @chrmoritz that did the trick.
Strange I didn't get any errors about that, thanks for the help
Most helpful comment
Does your
echo $PATH
contain/usr/local/bin
?If so I'd guess the linking step failed during the installation of
yarn
for some reasons. Try to rerun it withbrew unlink yarn && brew link yarn
and see if you get any errors.