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

Name conflict with Apache Hadoop Yarn #2337

Open
jspooner opened this issue Dec 24, 2016 · 18 comments
Open

Name conflict with Apache Hadoop Yarn #2337

jspooner opened this issue Dec 24, 2016 · 18 comments

Comments

@jspooner
Copy link

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?

% brew install yarn
Updating Homebrew...
==> Downloading https://homebrew.bintray.com/bottles/yarn-0.18.1.el_capitan.bottle.tar.gz
Already downloaded: /Users/jspooner/Library/Caches/Homebrew/yarn-0.18.1.el_capitan.bottle.tar.gz
==> Pouring yarn-0.18.1.el_capitan.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/yarn
Target /usr/local/bin/yarn
is a symlink belonging to hadoop. You can unlink it:
  brew unlink hadoop

To force the link and overwrite all conflicting files:
  brew link --overwrite yarn

To list all files that would be deleted:
  brew link --overwrite --dry-run yarn

Possible conflicting files are:
/usr/local/bin/yarn -> /usr/local/Cellar/hadoop/2.7.2/bin/yarn
==> Summary
🍺  /usr/local/Cellar/yarn/0.18.1: 5,639 files, 18.2M

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

brew install hadoop
brew install yarn

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

@UnrememberMe
Copy link

We run into the same issue, and decided to use yarnpkg instead.

@Iverson
Copy link

Iverson commented Feb 14, 2017

@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?

@daxsorbito
Copy link

Hi, any workaround for this?

@JonasGao
Copy link

same for me

@enw
Copy link

enw commented Apr 25, 2017

Workaround - alias hadoop yarn to '''yarn-hadoop''' before installing this yarn

@mysterycommand
Copy link

@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?

@UnrememberMe
Copy link

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).

ldez pushed a commit to gsemet/traefik that referenced this issue May 10, 2017
to avoid conflict with Hadoop Yarn cli.

I don’t know the best practice, but i do
have Apache Yarn installed on my machine, so
I get this conflict. Of course this conflict does
not arised when building within the docker.

yarnpkg/yarn#2337
Signed-off-by: Gaetan Semet <gaetan@xeberon.net>
@ericsoco
Copy link

From another dev, here is a workaround (untested by me):

  • brew link --overwrite yarn to install yarnpkg
  • create a script to put hadoop yarn earlier in your path, and execute that initialization script before you do any hadoop yarn work

@ghost
Copy link

ghost commented Aug 7, 2017

same problem !

@BYK
Copy link
Member

BYK commented Aug 7, 2017

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

m3co-code pushed a commit to m3co-code/traefik that referenced this issue Aug 22, 2017
to avoid conflict with Hadoop Yarn cli.

I don’t know the best practice, but i do
have Apache Yarn installed on my machine, so
I get this conflict. Of course this conflict does
not arised when building within the docker.

yarnpkg/yarn#2337
Signed-off-by: Gaetan Semet <gaetan@xeberon.net>
@AmmarHasan
Copy link

Any workaround for this?

@sohaibiftikhar
Copy link

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.

@jazzyfresh
Copy link

jazzyfresh commented Jan 12, 2019

Quickstart: Install from Tarball to avoid Hadoop Yarn conflict

Download the tarball

cd /opt
wget https://yarnpkg.com/latest.tar.gz

It is recommended that you verify the tarball before extracting

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

Extract tarball

tar zvxf latest.tar.gz    
# Yarn is now in /opt/yarn-[version]/

Remove conflicting Yarn binary

rm yarn-[version]/bin/yarn

Make yarnpkg binary accessible

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)

@8a8aleo
Copy link

8a8aleo commented Mar 29, 2019

Change the name

@oxbits
Copy link

oxbits commented Apr 28, 2019

@8a8aleo who do you want to change which name? This is confounding. Is this some sort of turf war?

@budowski
Copy link

budowski commented Jul 3, 2019

Another option (both MacOS and others):

  1. npm install -g yarn
  2. npx yarn

@simonrouse9461
Copy link

I suggest changing the project name to yarn.js and naming the binary yarnjs

@fahadsiddiqui
Copy link

fahadsiddiqui commented Jul 7, 2023

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.

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