Yarn: Installation Problem: [linux can't install yarn by recommend command]

Created on 4 Mar 2018  路  6Comments  路  Source: yarnpkg/yarn

Which operating system are you using:

System: Deepin Linux
Please describe the steps you took when trying to install Yarn and what went wrong:

steps

  • curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
    echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
  • sudo apt-get update && sudo apt-get install yarn

    problems

  • It seems that the command download the cmdtest but not yarn for me

  • the yarn --version shows the version is v0.27(not the latest version)
  • yarn init reports [error]No such file or directory

So this makes me confused, can you offer the correct way to install yarn.By the way, the Chinese version is not the same as English and needs to update.

needs-confirmation triaged

Most helpful comment

@ishowman Make sure you run sudo apt-get update after adding the Yarn repo

@benjaoming We could consider renaming the yarn package to yarnpkg (and making yarn a transitional package that just requires yarnpkg), but that should be a separate discussion. It's not directly related to this issue.

All 6 comments

Try uninstall cmdtest and see if that helps.

@Daniel15 I try sudo apt remove cmdtest on Ubuntu, and repeat the following command( with environment installed nvm):

  • curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
  • echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
  • sudo apt-get install --no-install-recommends yarn
    after typing sudo apt-get install --no-install-recommends yarn, the cdmtest is installed again.

This issue can probably be closed.

Sorry that this has to be a problem. In the same way that the Node package on Debian is called nodejs in Debian/Ubuntu, the maintainers of yarn should go for yarnjs or yarnpkg - and actually, there are helpful and willing Debian maintainers who are trying to package Yarn, addressing these issues:

See:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=843021

You can also refer to Yarn's decision making here: https://github.com/yarnpkg/yarn/issues/1656

The reason for this confusion is somewhat on the Yarn maintainers :) But they have already made this decision, so I'm not sure if they are interested in renaming their own Debian package to yarnpkg and adjust the documentation moving forwards. I think it can be done in a backwards-compatible way.

This would pave the way for the upcoming official Debian package which is worked on here:

https://salsa.debian.org/js-team/node-yarnpkg

I think this could be addressed and will alleviate future issues like this.

CC: @Daniel15

I have this problem on Ubuntu 18.04 LTS and fix it by:
sudo apt-get install yarn

@ishowman Make sure you run sudo apt-get update after adding the Yarn repo

@benjaoming We could consider renaming the yarn package to yarnpkg (and making yarn a transitional package that just requires yarnpkg), but that should be a separate discussion. It's not directly related to this issue.

@Daniel15 I think it would be okay to open the issue. You could consider the current state of the Debian packaging effort, and also whether your package should share the same name.

  • Sharing the same name: You probably have to consider to align versioning strings
  • Not sharing name: Consider conflicting with other package names that should not collide on the same system
Was this page helpful?
0 / 5 - 0 ratings