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

Add in documentation "Install from npm" #1082

Closed
luisvt opened this issue Oct 14, 2016 · 13 comments
Closed

Add in documentation "Install from npm" #1082

luisvt opened this issue Oct 14, 2016 · 13 comments

Comments

@luisvt
Copy link

luisvt commented Oct 14, 2016

Since yarn is a npm package it can also be installed as it. So that, please add in the documentation that you can install yarn executing next line:

npm install -g yarn

@jacobmischka
Copy link

jacobmischka commented Oct 15, 2016

It's listed on the install page under "Alternatives".

image

@Daniel15
Copy link
Member

Yes, it's on the "alternatives" tab as it's not the recommended installation method. It's primarily a fallback for environments where you can't use a native installer or package (for example, Mac OS before the Homebrew package was recently added). Going to close this out as this is working as intended. Thanks!

@jdalton
Copy link
Contributor

jdalton commented Oct 16, 2016

For folks coming from npm, which I imagine is most users, it's easy enough to remember npm i -g yarn compared to whatever wget, curl, apt-get, brew, yum, choco, or other alternative and it works across all platforms. I program on OS X and Windows pretty regularly so it's nice to have a handy, easy, cross platform install route. I assumed the npm route was moved to avoid jokes about using it to install another package manager.

@Daniel15
Copy link
Member

Daniel15 commented Oct 16, 2016

it's easy enough to remember npm i -g yarn compared to whatever

Anyone on Ubuntu should be familiar with dpkg (apt-get). Similarly, most people on Mac OS are familiar with Homebrew. Yarn should be seen as an "app" not an "npm package", and the best practice for apps is to use the native installation method for the host operating system.

I assumed the npm route was moved to avoid jokes about using it to install another package manager.

That's one reason 😛 Here's one of my comments from a few weeks ago (#385) that explains some of the rationale:

Advantages of using the system's native package manager rather than something like npm install -g yarn:

  • Upgrades are handled the same way as all other software on your system (apt-get upgrade). It's not a special snowflake.
  • All the security problems with npm (eg. packages not being signed) make it less than ideal for anything installed system wide. apt-get gives you proper GPG signature verification.
  • Using npm means you're tightly-coupled to npm. If you later want to have a better installation solution, you need to have this awkward transition period where you try to get users to switch to the newer installation method.
  • The setup instructions need the whole weird "install Node.js first, then ensure npm is up-to-date, then install Yarn" thing. That'd be like telling people to manually install their npm dependencies 😆 . With a proper package management system, the Yarn package would simply have a dependency on the Node.js package, and "apt-get install yarn" would install both.

If we want to appeal to people that have limited Node.js experience, we shouldn't make any assumptions that they know anything about the Node.js ecosystem or what "npm" even is.

@jdalton
Copy link
Contributor

jdalton commented Oct 16, 2016

@Daniel15

If we want to appeal to people that have limited Node.js experience, we shouldn't make any assumptions that they know anything about the Node.js ecosystem or what "npm" even is.

I donno, for folks with limited Node experience on Mac and Windows the go-to Node installs come bundled with npm and it's ingrained in the ecosystem. I get wanting a separation and a separate identity but think it's a lot of hoops to jump through to avoid.

@Daniel15
Copy link
Member

think it's a lot of hoops to jump through to avoid.

There's not really that many hoops though. It's identical to any other software you'd use on Windows or Mac OS. We're not doing anything strange or different to other apps at all 😄

@jdalton
Copy link
Contributor

jdalton commented Oct 16, 2016

There's not really that many hoops though.

Lets let a couple releases go by :D

Related to #1201, #1202, #1216, #1447, #1505.

@Daniel15
Copy link
Member

For what it's worth, releases are much easier to deal with when using the Ubuntu/Debian package, as Yarn will be upgraded along with the rest of the system. npm won't give you that; apt-get update && apt-get upgrade doesn't touch things installed via npm install --global. My understanding is that you need to manually update with npm.

@jacobmischka
Copy link

Can yarn update itself without breaking? If so, installing with npm would mean that it can be updated using yarn, right?

@jdalton
Copy link
Contributor

jdalton commented Oct 16, 2016

I know tools like greenkeeper can detect when they're out of date and prompt the user to action.

@Daniel15
Copy link
Member

Can yarn update itself without breaking?

There's a yarn self-update command but I'm not sure if it works 100% properly at the moment.

@donnoman
Copy link

you are too dependent on package managers doing the right thing for you, with containerization and limited build environments first and foremost we need a manual install that always works. Barring that the primary language package manager should be able to install it. Package management systems for dists are the last resort, they rarely have the latest package to install and you have to fall back to the other methods anyway.

@Daniel15
Copy link
Member

We have the installation script if you need a manual install that always works. Alternatively you can extract the tarball yourself.

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

5 participants