-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Document how to install yarn when you use nvm #3255
Comments
On Debian-based distros (including Ubuntu), you install Yarn this way to avoid installing a Node.js package:
Homebrew has a similar flag, but I can't remember it off the top of my head. The install script will also work:
|
@bestander triage; label: [documentation] (which doesn't seem to be an existing label... perhaps worth making?) |
now we have :) |
thanks for that - yeah, please document. and |
This is a community project, we hope that people who need this would step in and help each other, e.g. send a PR for documentation. |
alright, i ll do a PR next week. can you confirm the curl command installs only but doesn't update? |
That script should update |
I don't see that option in the formula: https://github.com/Homebrew/homebrew-core/blob/master/Formula/yarn.rb, I've opened Homebrew/homebrew-core#14026 for this to be added to the Yarn Homebrew package. |
I think there's an Sent from my phone. |
I created yarnpkg/website#516 per the above |
|
Just an update for anyone who comes across this issue via Google search...Yarn documentation now says that Yarn can be installed on a Mac, via Homebrew, without node, like this: brew install yarn --without-node |
@andrewhavens your note timestamp is right on time. TY |
Sorry I didn't answer that! It shouldn't - AFAIK Debian only looks at "recommended" packages on initial installation, not on upgrades. |
What about installing on CentOS/Fedora using nvm? |
yum says the following…
I presume I want to install yarn and libuv but not nodejs. Correct? --- edit --- Actually, it looks like libuv is a dependency of node so it should already be managed by nvm — so I just want yarn itself and none of the dependencies? |
Maybe I'm missing the obvious. There is presumably no harm in having the node package installed when I am using nvm. Right? That means I don't actually have to skip installing the dependencies (which can't be done via yum without first modifying the package). |
Anyone know how to do this on Solus? |
|
@binarykitchen can you add @andrewhavens comment to your initial comment as an edit? it would be very helpful to have that at the top of the page for people who come here from google. |
still wants to install
I guess it is because of this commit Homebrew/homebrew-core@a34c721 but I'm not 100% sure as I have little knowledge of Homebrew. |
Following @andrewhavens comment in the thread, another update for anyone who comes across this issue via Google search. Yarn documentation currently says to install using Point being, homebrew devs are essentially saying that you must install node from homebrew because homebrew doesn't support installation options anymore (warning long thread, lots of heated discussion). And because yarn cannot work without node, obviously, they will install a system wide node for you. If you still don't want to install node from homebrew simply do |
if anyone else comes across this issue from google and has the following setup like me: node installed from nvm, path correctly updated to include nvm's binary path but brew will still refuse to use that node version, you can try the following: you can use |
@alexraileanu |
@wadkar yeah tho in my case, for whatever reason, brew would not find the node binary in my path so when i ran with |
thanks @alexraileanu |
It now seems the recommended way to install yarn is via npm. So if you're using nvm, Homebrew should not be used for Node (to avoid an extra Homebrew Node being installed) or yarn (to avoid yarn being installed outside of nvm). nvm will use Glad to be corrected, but this seems to be the most up-to-date way of installing yarn when using nvm. Interestingly, this does seem to mean that sometimes |
I have a mess here on my both machines, running on Ubuntu and Mac OS. Both have the same problem: how to install yarn properly when you use nvm?
nvm, as you know, is an isolated nodejs manager. But when you do
brew install yarn
orsudo apt-get install yarn
, then a system-wide nodejs version is installed (as a dependency)This nodejs dependency is breaking a lot on my machines. This isn't working well. Ideally it would be good if we still can install and upgrade yarn through npm; or at least make brew + apt-get smarter, not installing the nodejs dependency when nvm already exist.
Looking at older issues, I see this has been discussed but there are too many comments to process. Can we agree to an official solution to the above and document this on the installation page?
The text was updated successfully, but these errors were encountered: