Install yarn in a docker container, says no addiction

I use the node: 6.7.0 image as a docker container and then follow the yarn installation guide

sudo apt-key adv --keyserver pgp.mit.edu --recv D101F7899D41F3C3
echo "deb http://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list

Then i do

apt-get update && apt-get install yarn

But at this moment I get an error message that says

yarn : Depends: nodejs (>= 4.0.0) but it is not going to be installed

I repeated node -vbefore installation, and he also says6.7.0

Anything I miss?

+4
source share
1 answer

robertklep is correct - if you check the Dockerfile for Node you will see that they install Node by loading the tar, not through APT. You can verify this by running the interactive container:

> docker run -it node:6.7.0 bash
root@465fa07437c9:/# dpkg -s nodejs
dpkg-query: package 'nodejs' is not installed and no information is available

NPM Dockerfile:

FROM node:6.7.0
RUN npm install -g yarn
+5

Source: https://habr.com/ru/post/1657718/


All Articles