Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yarn global ls does not list global packages #3142

Closed
jmsmrgn opened this issue Apr 14, 2017 · 25 comments
Closed

yarn global ls does not list global packages #3142

jmsmrgn opened this issue Apr 14, 2017 · 25 comments

Comments

@jmsmrgn
Copy link

jmsmrgn commented Apr 14, 2017

Do you want to request a feature or report a bug?

bug

What is the current behavior?

$ yarn global ls
yarn global v0.23.2
warning No license field
✨  Done in 0.20s.

If the current behavior is a bug, please provide the steps to reproduce.

yarn global add <pkg>
yarn global ls

What is the expected behavior?
list all globally installed packages

info "pkg" has binaries:
   - command
info "pkg" has binaries:
   - command
info "pkg" has binaries:
   - command

Please mention your node.js, yarn and operating system version.
node v7.9.0 (installed w/nvm)
yarn v0.23.2 (installed w/curl)
mac OS 10.12.4

yarn v0.22.0 contains #2689 and rolling back to v0.21.3 fixes the issue.

@rockchalkwushock
Copy link

I found the same thing.

I have a ~/.config/ directory that has yarn/global/. I can look at the package.json there and see what is installed globally and the /node_modules/ directory is present there too.

yarn bin # /Users/codybrunner/node_modules/.bin
yarn global bin # /usr/local/bin

I'm not 100% understanding the paths for both of these and how I end up with globals being installed at & read from ~./config.

When I installed yarn I did the following (followed #630 for prefix):

brew install yarn
yarn global bin # /usr/local/Cellar/node/7.9.0/bin
yarn config set prefix /usr/local/
vi ~/.profile
# export PATH=/usr/local/Cellar/node/7.9.0/bin:$PATH
source ~/.profile
# new path for global bin
yarn global bin # /usr/local/bin

All globals are working fine I just don't understand why globals are being installed where they are being installed. I think that is the issue for yarn global ls because shouldn't that be looking at the path of yarn global bin? If so then it makes sense that the command is finding nothing.

node: 7.9.0
npm: 4.2.0
yarn: 0.23.2
macOS: 10.12.4

@tacomanator
Copy link

Also have this issue. Possibly related to #648?

Tried removing and reinstalling node, npm, and yarn with various methods (from the package, from homebrew, script) each with the same result: yarn global bin gives /usr/local/bin but globally installed packages are being placed in $HOME/.config/yarn/global/node_modules/.bin.

Is the library moving things around and out of sync?

Also confirmed that global list still does work in 0.21.3.

@luftywiranda13
Copy link

yes i have exactly the same problem.
Globally installed packages are working just fine

But yarn global ls shows nothing instead of just done

@redstrike
Copy link

redstrike commented Apr 23, 2017

Same problem on Windows 10 Pro ver. 1703 (Creator Update)

image

# yarn --version
0.23.2

voxsim added a commit to voxsim/yarn that referenced this issue Apr 23, 2017
voxsim added a commit to voxsim/yarn that referenced this issue May 1, 2017
voxsim added a commit to voxsim/yarn that referenced this issue May 2, 2017
arcanis pushed a commit that referenced this issue May 2, 2017
* add test for global bin command

* add test for global add command

* add test for global remove

* add test for global ls command and fix issue #3142

* add test for global upgrade

* move tests with side-effects under isCI branch; the other tests now are side-effects free

* the global folder in win32 platform is prefix env/parameter without bin folder inside, do assert only on global folders for yarn global v0.23.3
Done in 0.26s.
@grawlinson
Copy link

This is happening for me also. I can still access the globally installed packages just fine.

Outputs:

yarn bin and npm bin both result in: <currentPackage>/node_modules/.bin
yarn global bin and npm -g bin both result in: $HOME/.local/share/npm/bin

$ yarn global ls
yarn global v0.23.3
warning No license field
Done in 0.37s.

npm list -g --depth=0 returns a list of packages globally installed by npm, but none of the packages globally installed by yarn.

versions:

  • node 7.9.0
  • npm 4.5.0
  • yarn 0.23.3

NOTE: I have custom npm config directories set, so that is why my directories may be different. If required, here's the relevant snippet from my zsh config files:

export NPM_CONFIG_USERCONFIG=$XDG_CONFIG_HOME/npm/config
export NPM_CONFIG_CACHE=$XDG_CACHE_HOME/npm
export NPM_CONFIG_TMP=$XDG_RUNTIME_DIR/npm
export NPM_CONFIG_PREFIX=$XDG_DATA_HOME/npm

PATH="$NPM_CONFIG_PREFIX/bin:$PATH"

Let me know if more information is required. I'm interested in getting to the bottom of this.

@khaosdoctor
Copy link

Just the same issue, all the globally installed packages I have, I did it with yarn so npm list -g --depth=0 lists nothing as expected, but yarn global ls lists nothing too... Just "Done"

@rockchalkwushock
Copy link

@voxsim this looks to be solved in #3238 & will be rolled out in yarn@0.24.0 correct?

Should we close?

@voxsim
Copy link
Contributor

voxsim commented May 5, 2017

@rockchalkwushock yep I think so :) please let me know it is ok!

@dwiyatci
Copy link

dwiyatci commented May 5, 2017

Can't wait for release 0.24! 😁

@jmsmrgn
Copy link
Author

jmsmrgn commented May 9, 2017

Fixed in RC v0.24.2

@jmsmrgn jmsmrgn closed this as completed May 9, 2017
@ipa1981
Copy link

ipa1981 commented May 31, 2017

Something is not good here (version v0.24.5).

$ npm -g --depth=0 list
/usr/local/lib
├── gulp-cli@1.3.0
...

$ yarn global ls --depth=0
yarn global v0.24.5
warning No license field
info "vue-migration-helper@1.1.6" has binaries:
   - vue-migration-helper
Done in 0.49s.

@luchillo17
Copy link

@ipa1981 You need to set either yarn prefix to npm's one, or the other way around, and then reinstall all packages that aren't listed.

I've also noticed that yarn will list only those packages with binaries.

@ipa1981
Copy link

ipa1981 commented Jun 12, 2017

@luchillo17 shouldn't this work out of the box?

@luchillo17
Copy link

Yes, that's just a hack for you to get going meanwhile.

@khaosdoctor
Copy link

Yarn 0.24 corrected it for me

@luchillo17
Copy link

luchillo17 commented Jun 13, 2017

@khaosdoctor 0.24.x which patch version? i have 0.24.6, i guess i'll try RC version (if i find how to install it with Brew).

@ipa1981
Copy link

ipa1981 commented Jun 13, 2017

@luchillo17 @jmsmrgn mentioned it was Fixed in RC v0.24.2, but it doesn't look to be so in our cases.

@khaosdoctor
Copy link

@luchillo17 I'm using 0.24.6 and it is corrected here 😮

@ipa1981
Copy link

ipa1981 commented Jun 13, 2017

@khaosdoctor I use 0.24.6 and it doesn't produce same list as npm.

~:~$ npm -g --depth=0 list
/usr/local/lib
├── gulp-cli@1.3.0
├── mup@1.2.10
├── node-gyp@3.6.2
├── npm@5.0.3
└── vue-migration-helper@1.1.6

~:~$ yarn global ls --depth=0
yarn global v0.24.6
warning No license field
info "vue-migration-helper@1.1.6" has binaries:
   - vue-migration-helper
Done in 0.60s.



@luchillo17
Copy link

@khaosdoctor What i refer is the output of @ipa1981, the list of global packages is different between npm & yarn, in my case and his with 0.24.6.

@khaosdoctor
Copy link

@luchillo17 @ipa1981 Indeed, My yarn command returns mostly the same modules, but not all of the listed on npm and vice versa

@alexpovh
Copy link

Getting the same issue with yarn@1.6.0 yarn global list does not output any information on the globally installed packages.
image

@phwb
Copy link

phwb commented May 16, 2018

Getting the same issue with yarn@1.6.0 yarn global list does not output any information on the globally installed packages.

Same problem

@mcissel
Copy link

mcissel commented Jun 6, 2018

same in yarn@1.7.0
yarn global list is only showing packages that have binaries

@rightaway
Copy link

Same in yarn 1.9.4. Any plans to fix this? Or at least not mark the issue as closed...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests