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 downloads now every time #602

Closed
albinekb opened this issue May 30, 2017 · 19 comments
Closed

Yarn global downloads now every time #602

albinekb opened this issue May 30, 2017 · 19 comments
Assignees
Labels
triaged: bug Issue or PR has been reviewed by a maintainer and work is being tracked

Comments

@albinekb
Copy link
Contributor

albinekb commented May 30, 2017

image

Whenever i install something globally, now seems to download itself again? and build?

output when done

❯ yarn global add fkill-cli
yarn global v0.24.6
warning No license field
[1/4] πŸ”  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] πŸ”—  Linking dependencies...
[4/4] πŸ“ƒ  Building fresh packages...
[1/1] β ‚ now: > For the sources, check out: https://github.com/zeit/now-cli
success Installed "fkill-cli@3.6.0" with binaries:
      - fkill
warning No license field
✨  Done in 34.88s.

I guess it's because the πŸ“ƒ Building fresh packages step, but I think this should be fixed, since it makes global install a lot slower

@chabou
Copy link
Contributor

chabou commented May 30, 2017

now is redownloaded with a yarn global ls. Maybe it is a yarn bug ?
capture d ecran 2017-05-30 a 08 08 42

@albinekb
Copy link
Contributor Author

Here's the problem: iarna/in-publish#9

But I don't understand this download thing that's going on, why not just publish the package and let npm/yarn handle the download 😱

@leo
Copy link
Contributor

leo commented May 31, 2017

@albinekb We need a separate binary per platform, otherwise we would simply include it in the package, of course! 😊 We can't ship all binaries, then the package would be too huge.

@albinekb
Copy link
Contributor Author

albinekb commented May 31, 2017

But why ship the binary in npm when you install with npm (or yarn) it's 100% that you have node installed too, then you download another copy of node? πŸ€”

The binary is great for brew etc but it feels weird to download all source files and a compiled binary with another version of node when installing with n(ode) package manager ?

@leo
Copy link
Contributor

leo commented May 31, 2017

@albinekb We've talked several weeks about this internally and it was a hard decision - but here are the reasons (+ we can control the node version).

@albinekb
Copy link
Contributor Author

albinekb commented May 31, 2017

We're able to select our own Node version of choice and can take advantage of the latest features

This makes it totally worth it πŸ˜‚ (gonna start ship node 8 with all my CLIs :trollface:)

Increased safety by providing a unified signature mechanism for releases

There are no signature checks (if i'm not missing them) https://github.com/zeit/now-cli/blob/master/download/src/index.js

but ok. the consistency part is πŸ‘

I'll have a PR up tomorrow with a fix for yarn and prepublish, tired of waiting for the now download every time I do something global :spinner:

@jesstelford
Copy link

jesstelford commented Jul 4, 2017

Running into this today to the point where the now binary download hangs, meaning I can't yarn global add anything :'(

Edit: After reading the link from @leo, I can't say I agree with any of those points except the first one:

Simpler installation for non-Node users like those deploying static files or Dockerfiles.

In all other cases, it's more of a hassle, and more of a network drain to re-download a huge binary (even if you already have it installed) every time you install another package.

For the non-Node use-case; provide a binary, that's a great idea. But for the node-use case, it should be shipping the code. Use babel if you have to, or put a minimum node version required in the package.json's "engine" field.

@leo
Copy link
Contributor

leo commented Jul 4, 2017

We've been through all of that for more than a year now (since the first CLI release) and it never worked out for us. In turn, we decided to go this road. When thinking about this, Now Desktop (which also installs the bundled CLI and can never install a npm package) also needs to be considered. This - as it is - is simply the best solution to cover all cases.

Let's take a look at how to fix this yarn issue! npm is already handling it properly.

@mattfysh
Copy link

mattfysh commented Jul 7, 2017

Also getting severely hampered by this issue, may try and use just npm for now-cli and yarn for everything else... unless anyone knows of another workaround for yarn?

@matheuss
Copy link
Member

@leo @igorklopov any update on this? yarn global add sth takes a long time every time 😩

@igorklopov igorklopov self-assigned this Jul 29, 2017
@wong2
Copy link

wong2 commented Aug 4, 2017

I'm facing this problem too. What's worse, the request hang up with ECONNRESET, which makes the install failing.

@mattfysh
Copy link

I believe this is fixed in the latest release of now? Just switch from an npm global to yarn global install, and all is well

@albinekb
Copy link
Contributor Author

Yep seems to be fixed!

@albinekb
Copy link
Contributor Author

albinekb commented Feb 9, 2018

This is back again:

reforce@reforces-MacBook-Pro ~/D/frontend-construction> yarn global remove scandium
yarn global v1.3.2
[1/2] Removing module scandium...
[2/2] Regenerating lockfile and installing missing dependencies...
[1/1] β’€ now: > For the source code, check out: https://github.com/zeit/now-cli
[-/1] β’€ waiting...
[-/1] β’€ waiting...
[-/1] β’€ waiting...
[-/1] β’€ waiting...

Why does it download now when I'm removing another completely unrelated package? This is nuts.

@albinekb albinekb reopened this Feb 9, 2018
@mattfysh
Copy link

@leo @igorklopov do you guys just not use yarn? is that the reason for this issue being ignored for so long? or, does the bug lie with yarn & you need them to fix first?

@jesstelford
Copy link

jesstelford commented Apr 16, 2018

Ooof, ran into this again today - trying to do a yarn global add gatsby-cli, just hangs while now spins. A quick yarn global remove now makes all the issues go away.

Using npm install -g now works fine.

Really wish there was a solution for this that didn't involve breaking yarn :(

Edit: Nope, still broken. Turns out yarn global remove now didn't actually remove now.

Instead, it left /Users/jess/.config/yarn/global/node_modules/.bin/now binary (which links to /Users/jess/.config/yarn/global/node_modules/now/download/dist/now). But that binary contains the following:

#!/usr/bin/env node
console.log("The 'now' installation did not complete successfully.")
console.log("Please run 'npm i -g now' to reinstall!")

Not sure if that comes from npm or yarn, but either way it's busted 100%.

Edit 2: Doing a rm -rf /Users/jess/.config/yarn/global/node_modules/now fixed it, so it's using the npm version.

What a rollercoaster!

@leo leo added implementation upcoming triaged: bug Issue or PR has been reviewed by a maintainer and work is being tracked and removed triage labels Nov 13, 2018
@jamonholmgren
Copy link

I believe this issue is directly related to this Yarn issue: yarnpkg/yarn#5680

@Akryum
Copy link

Akryum commented Apr 16, 2019

Still happening, and if you don't have fiber, you're basically screwed up...

@leo
Copy link
Contributor

leo commented Jul 25, 2019

We've gotten rid of the old installation mechanism. Please try now@canary. We'll soon push this to the stable channel too!

@leo leo closed this as completed Jul 25, 2019
TooTallNate pushed a commit that referenced this issue Aug 23, 2019
* move @types/node to dependencies

* fix types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triaged: bug Issue or PR has been reviewed by a maintainer and work is being tracked
Projects
None yet
Development

No branches or pull requests