I am unable to run apt-get install yarn
on the node:6.70 docker image.
Here is the error message:
The following packages have unmet dependencies:
yarn : Depends: nodejs (>= 4.0.0) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
root@197593b5f9e9:/# node -v
v6.7.0
root@197593b5f9e9:/# nodejs -v
v6.7.0
The base docker image is here:
https://hub.docker.com/_/node/
https://github.com/nodejs/docker-node/blob/4029a8f71920e1e23efa79602167014f9c325ba0/6.7/Dockerfile
FROM node:6.7.0
RUN apt-key adv --keyserver pgp.mit.edu --recv 9D41F3C3 && \
echo "deb http://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt-get update && \
apt-get install yarn
I don't think yarn is available yet in APT. You'll need to install it manually from the tar or npm install -g yarnpkg
. More info
I'm following what is on the installation docs: https://yarnpkg.com/en/docs/install
Debian/Ubuntu Linux
npm install -g yarnpkg
does work for me, and is super fast!!!
Ah! My apologies.
It looks like it is trying to find the binary nodejs
instead of node
.
Edit: Looks like you got it linked as nodejs
as well.
@donovan-graham - The Debian/Ubuntu package is called nodejs
and that's what Yarn depends on. It looks like that Dockerfile downloads a prebuilt version of Node.js and directly installs the binary, rather than installing it via apt-get
. This means that it's a special snowflake and apt-get
has no way of knowing that it's installed 馃槢
I suspect it'll work fine if you update the Dockerfile to install Node.js by using apt-get install nodejs
(on Ubuntu 16.04 this will get you Node.js 4.x, you can use NodeSource's repo to get Node.js 6.x)
You'll need to install it manually from the tar or npm install -g yarnpkg. More info
npm installation is just a fallback, mainly for platforms that aren't officially supported (and for Mac until we have Homebrew configured). For Ubuntu and Debian we recommend using the package repo, and for Windows we recommend the installer 馃槃
Great, thanks for the quick reply. I'll give it a shot! 馃憤
$ sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev nodejs yarn
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package yarn
How to slove this error ??
How to slove this error ??
@ShubhamChauhanJi You need to ensure you add the Yarn repo. See the installation instructions on the Yarn site.
Most helpful comment
I don't think yarn is available yet in APT. You'll need to install it manually from the tar or
npm install -g yarnpkg
. More info