yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.4k stars 2.72k forks source link

Name conflict with Apache Hadoop Yarn #2337

Open jspooner opened 7 years ago

jspooner commented 7 years ago

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 commented 7 years ago

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

Iverson commented 7 years ago

@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 commented 7 years ago

Hi, any workaround for this?

JonasGao commented 7 years ago

same for me

enw commented 7 years ago

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

mysterycommand commented 7 years ago

@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 commented 7 years ago

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

ericsoco commented 7 years ago

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

ghost commented 7 years ago

same problem !

BYK commented 7 years ago

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

AmmarHasan commented 6 years ago

Any workaround for this?

sohaibiftikhar commented 6 years ago

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 commented 5 years ago

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 commented 5 years ago

Change the name

oxbits commented 5 years ago

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

budowski commented 5 years ago

Another option (both MacOS and others):

  1. npm install -g yarn
  2. npx yarn
simonrouse9461 commented 1 year ago

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

fahadsiddiqui commented 1 year ago

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.