Open jspooner opened 7 years ago
We run into the same issue, and decided to use yarnpkg instead.
@UnrememberMe I can't even install it from apt-get
sudo apt-get install yarn
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
golang-go-linux-amd64 golang-src rlwrap
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
yarn
0 upgraded, 1 newly installed, 0 to remove and 153 not upgraded.
Need to get 0 B/1,743 kB of archives.
After this operation, 26.1 MB of additional disk space will be used.
(Reading database ... 125365 files and directories currently installed.)
Preparing to unpack .../archives/yarn_0.19.1-1_all.deb ...
Unpacking yarn (0.19.1-1) ...
dpkg: error processing archive /var/cache/apt/archives/yarn_0.19.1-1_all.deb (--unpack):
trying to overwrite '/usr/bin/yarn', which is also in package hadoop-yarn 2.5.0+cdh5.3.0+781-1.cdh5.3.0.p0.54~trusty-cdh5.3.0
Errors were encountered while processing:
/var/cache/apt/archives/yarn_0.19.1-1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
yarnpkg binary not installed. Is there any workaround for Linux?
Hi, any workaround for this?
same for me
Workaround - alias hadoop yarn to '''yarn-hadoop''' before installing this yarn
@UnrememberMe, any advice on how you got yarnpkg
working with Hadoop YARN already installed? Trying to automate installing yarnpkg
through yum
where hadoop-yarn
is already installed as yarn
… can't move/alias it away (as @enw suggests) because it might be in use/running at the time.
Would love to just sudo yum install yarnpkg
… any chance this package could be published under 2 names? Like, just create a yarnpkg.repo
akin to yarn.repo
? Is that … bad?
We use yarnpkg
as command line entry point instead since what yarn command line client does make no difference for my environment setup (all Linux machines).
From another dev, here is a workaround (untested by me):
brew link --overwrite yarn
to install yarnpkg
same problem !
If someone can propose a solution that Yarn can adopt, I'd be more than happy try implementing that. Otherwise I'm not sure if we should keep this issue open since it won't be actionable by yarn unless we change the name and that's certainly not happening :D
Any workaround for this?
The easiest way for me to fix was to not use a package manager for installing yarn
. Just used the tarball to install and made aliases.
cd /opt
wget https://yarnpkg.com/latest.tar.gz
wget -qO- https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --import
wget https://yarnpkg.com/latest.tar.gz.asc
gpg --verify latest.tar.gz.asc
# Look for "Good signature from 'Yarn Packaging'" in the output
tar zvxf latest.tar.gz
# Yarn is now in /opt/yarn-[version]/
rm yarn-[version]/bin/yarn
Add this to your profile:
export PATH="$PATH:/opt/yarn-[version]/bin"
(the path may vary depending on where you extracted Yarn to)
source ~/.bash_profile # or .bashrc or .profile depending on your OS
(this is just a compilation of existing documentation and the comments above)
Change the name
@8a8aleo who do you want to change which name? This is confounding. Is this some sort of turf war?
Another option (both MacOS and others):
npm install -g yarn
npx yarn
I suggest changing the project name to yarn.js and naming the binary yarnjs
I have
hyarn () {
alias yarn=/opt/homebrew/bin/yarn
}
jyarn () {
alias yarn=/usr/local/bin/yarn
}
jyarn
export PATH="$(yarn global bin):$PATH"
hyarn
I have this in my dot file to context switch between the two yarn commands. And I am exporting the functions hyarn
and jyarn
as
export hyarn
export jyarn
Stays very handy for me.
For example, for Hadoop yarn
fahad in ~ λ hyarn
fahad in ~ λ yarn
Usage: yarn [OPTIONS] SUBCOMMAND [SUBCOMMAND OPTIONS]
or yarn [OPTIONS] CLASSNAME [CLASSNAME OPTIONS]
where CLASSNAME is a user-provided Java class
OPTIONS is none or any of:
and for yarn
for JS
fahad in ~ λ jyarn
fahad in ~ λ yarn
yarn install v1.22.10
[1/4] 🔍 Resolving packages...
success Already up-to-date.
✨ Done in 0.05s.
Do you want to request a feature or report a bug?
Bug. When trying to install Yarn pkg manager there is a name conflict with Apache Hadoop Yarn.
What is the current behavior?
If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
The the yarn binary should not conflict with the Hadoop yarn.
Please mention your node.js, yarn and operating system version.
NPM: 3.10.3 OSX: 10.11