Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install Yarn Ubuntu 16.04 (Linux Mint 18.1)

I have a new installation of Linux Mint 18.1 with Ubuntu 16.04. I have installed Node 6.10.0.

When doing the command that indicates the documentation of Yarn:

sudo apt-get update && sudo apt-get install yarn

It says "could not find yarn package"

I must do something else, because in the documentation I do not see anything about it.

Thank you.

enter image description here

like image 920
Jose Avatar asked Mar 05 '17 10:03

Jose


People also ask

Is yarn available on Ubuntu?

You will need to install Node.js if you don't already have it installed. On common Linux distributions such as Debian, Ubuntu and CentOS, it is recommended to install Yarn via our packages instead.

Can I install yarn with npm?

The Yarn maintainers recommend installing Yarn globally by using the NPM package manager, which is included by default with all Node. js installations. Use the -g flag with npm install to do this: sudo npm install -g yarn.


3 Answers

On Ubuntu Linux, you can install Yarn via Debian package repository. You will first need to configure the repository:

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

Then you can simply:

sudo apt-get update && sudo apt-get install yarn

More information here

like image 191
Shaig Khaligli Avatar answered Oct 12 '22 05:10

Shaig Khaligli


I was unable to install Yarn on Ubuntu 16.04 using the accepted answer but found it easy with npm:

npm install -g yarn

Then check install / version with

yarn --version

like image 44
ow3n Avatar answered Oct 12 '22 04:10

ow3n


See on Installation | Yarn | Linux tab

There are instructions for several linux distributions

like image 5
simhumileco Avatar answered Oct 12 '22 06:10

simhumileco