I am using macOS Sierra 10.12.4 and I have installed yarn by brew install yarn
and its version is yarn version v0.23.2
I installed angular-cli
, bower
and ionic
using yarn global add <package-name>
Then I use yarn global ls
to display globally installed packages and I am expecting to see the above installed packages but yarn gives me this:
$ yarn global ls yarn global v0.23.2 warning No license field ✨ Done in 0.99s.
Then i check yarn global bin
and get path /Users/myusername/.config/yarn/bin
and I go to the directory and see softlinks:
lrwxr-xr-x 1 myusername staff 38B 19 Apr 10:17 bower -> ../global/node_modules/bower/bin/bower lrwxr-xr-x 1 myusername staff 42B 19 Apr 10:21 cordova -> ../global/node_modules/cordova/bin/cordova lrwxr-xr-x 1 myusername staff 38B 19 Apr 10:20 ionic -> ../global/node_modules/ionic/bin/ionic lrwxr-xr-x 1 myusername staff 41B 19 Apr 10:15 ng -> ../global/node_modules/angular-cli/bin/ng
Apparently all packages were installed and saved under /Users/myusername/.config/yarn/global/node_modules
I searched the following threads https://github.com/yarnpkg/yarn/issues/2446
Tried appending the below paths but still not work:
YARN_BIN=$HOME/.config/yarn/bin # `yarn global bin` result export PATH=$YARN_BIN:$PATH export PATH=$PATH:$HOME/.config/yarn/global/node_modules/.bin
Can anyone help? What should I do and how to display the globally installed packages?
yarn will ensure all global packages will have their executables installed to ~/. yarn/bin . yarn global dir will print the output of the global installation folder that houses the global node_modules .
To view the npm global packages list and their dependencies, you can run the following npm list command followed by the “-g” flag where g stands for global. As you can see in the above result, all the global packages are displayed in a tree-like structure.
The Yarn maintainers recommend installing Yarn globally by using the NPM package manager, which is included by default with all Node. js installations. Use the -g flag with npm install to do this: sudo npm install -g yarn.
yarn global list
The command had issue in Spring 2017, that had been fixed.
Currently I directly list Yarn global packages folder content:
%LOCALAPPDATA%/Yarn/config/global
~/.config/yarn/global
/usr/local/share/.config/yarn/global
As of May 12, 2017 this problem has been resolved. See issue and pull request.
So you can use yarn global list
to list all globally installed packages.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With